Here are the relevant bits of my function:
// Finally send the JSON data to the browser or requestor res.status(200).send(output); } catch (err) {