how to check status code of api response