Remove the misplaced res.end and force UTF-8
Merge conflict fixed