updated to support specifying the api endpoint port

Signed-off-by: Chris Jones <chris@jonezy.org>