Fix for #1840: we expect 500 server errors to also return JSON messages