Implenented very basic tree API and rest of tree structure