added tests for json routes, minor view cleanup