Changing hangar middleware to use res.end instead of res.send