Added verbose error message for a wrong status

If the server returns a 404 error message for the api url then the code will break when a subsequent method tries to analyse that response body. This way the error is clearer.