Allow custom api url

Hello :)

This PR lets the API url be changed during construction. This enables the use of test libraries that capture HTTP requests (specifically I'm using https://github.com/rest-driver/rest-driver/wiki/Client-driver).