Group tree retrieval code for jsTree.