Made getRoutes function