use flask's built-in jsonify for responses