logging for api calls