Added logging to API