Fixing tests, better error handling

Not blocking for this code review, but I wonder whether we should have the starting URL as a parameter to a function rather than exposing it as an exportable property. The reason I ask is because I'm wondering whether it enable a piece of code to get into the state where the entry point URL was changed mid-way through a client workflow - and if so, what damage that could cause. 

Probably not a huge deal at the moment given how our APIs are written, but if we move to a more RESTful style on the back end, we probably want the entry point to be set initially and then not changed.