jsonify from classmethod to function.