API: custom middleware for testing slow requests