Encapsulated all routes in controllers. Also created flash messages