expressjs middleware for injecting some code in result