Next API Middleware

Add middleware to API routes for validation, logging, or authentication.