Raise exception if there is a server error

Today the API was down (but serving a 200 response with a `"{'error':'...'}"` body) and the generate method was returning `nil`, because the #request method just parses the response body and returns the :results key. I think it makes better sense to raise an error in this case rather than have dependent code try and handle a nil, which can happen in all sorts of instances. Added a test for it too.