stats endpoints, refactored routes and querybuilders