Added a `handler` parameter

This allows the developer to further customize how requests are handled during high traffic peaks and even overriding the middleware's default behavior.