Adding API routes and handlers