(PDB-658) Moved event-counts endpoints to the query engine

aggregate event counts just delegates to event counts and event counts
delegates to events sql function. Switching that call to conditionally use
the query engine (for :v4 when distinct-resources? are false) moved it
over, no additinoal query engine functionality was needed.