add a simple middleware that wraps res:send