changed res.end to  res.end()