Tidying up the tests. Small issue is that if the api return a url type error, we get an uninformative error message...