Res.end Middleware