Externalize API routes