Getting the response of a API call