save rule tree to json object