Do not hardcode API port when registering endpoint

We have an attribute to set it.
Merge pull request #56 from vuntz/no-hardcoded-api-port

Do not hardcode API port when registering endpoint