Moved res.end() to the end;