Simplify json logic in tests
Implement routes API