Fix: Query logging in apiEvents