Test for 5XX responses from server & raise if necessary

Fixes #26. Difficult to test given current testing infrastructure.