Middleware ordering API