Write to JSON