test that the JSON endpoint returns a proper error message