Added res.end() to api route