add "count" route to all resources
fix some tests
Merge branch 'count-relations'