Adjusted URL routing and wrote some tests