Added routing and refactored code into specific controllers