Added json format and saving func into *.json file