transform router `req` and `res` to object