Check if the response returned a correct status code