remove port from apiHost when constructing socketEndpoint