++get_tree method with json support