Save function data in JSON