Switch around the error logging and response code