check if the response is ok.