updated to support setting of the api host