changing check to use http_status codes