You should check `if err?` and `if res.statusCode is 200` before parsing the body. Either of those is an indicator something went wrong, so JSON.parse is going to fail.