URL and Basic Auth changes

Use the URL entered into the address bar when querying the api docs.
This ensure the same hostname or IP is returned by the server, and no
CORS error when querying resources.

Added Basic Auth support in page, but because of local queries the
server doesn't prompt for it. Might remove this later on.