Added logging to the API wrapper