use res.json instead of res.send and also added proper status code