added logging to API