Migrating an Express custom server to Next.js API routes