Add logging in the API