consolidated res.write and res.end to simply res.end