Configure custom ports

Fixes issues with API connection via non-standard HTTP port.