Now throws error if request status code is not 2XX

Resolves #34

Also, a test fix (to do with previous changes). Hope it doesn't break anything.