add func to return json with proper header

- flask's jsonify only takes a dict, you'll need this for an array