converts dictionary to json file