Working json version request counter using middleware.