improved logging in case of an exceptional error in api callbacks