completed basic jsonify function