add rack middleware for reporting