switches the response to be on either error or success