Include most recent period in stats endpoints
Added tests for /api/stats output
Moved tracking tests into api namespace