Getting a functional json tree.