update client to return status code only when request is not successful