write json to file

the data from the json object is now written to a file. this file can be
read as a json object