added routes to index.php and methods to AppController.php