These need to be handled separately when the server encounters an error and returns HTML instead of JSON.