For 1
, you would have to configure the external domain as a custom domain in APIM.
For 2
, looks like the default hostname used in the developer portal is the first available one (this line specifically) but since the developer portal is open source, you could customize it to your needs and self-host it as well.