Tree building based on JSON file.