Simplifying code for categories routes. Fix #294

Unified 4 routes to make it simpler to handle and avoid too much
repetition of code. I think we can do even better in a future iteration.