Added logic for sending routes to views in controllers