Added http basic authentication and custom api endpoint.

Fixed test