Added saving-as-json function and the JSON file