Added http basic authentication and custom api endpoint.

Fixed test
Merge pull request #172 from blaugueux/http-basic

Added support for HTTP Basic authentication and custom api endpoint.