Use addRoutes() instead of manually creating routes in a loop