refactored how routes are applied and add controllers