Change Request Middleware to Signal handler

Fix counter not getting reset

Add alert when sessions are reset

Add tests for request handler