Moved out routes to view.py