working on constructing tree data structure from URI