Bug 1024920 - added a middleware for reporting needs

This is still not the case. Please remove the tests from here and put them in the middleware_test.js