When getting an error from the api we only get a string, such as: Error returned by API: The page you specified doesn't exist.
I would find it more convenient for error handling to give back the original API response, so we can do tests like if (response.code === 'missingtitle') { ... }