added the tree-parse file and incorporated as API