Fix logging of API calls