fixed #393 - refactored basic route handling, moved some other routes to debug routes