Bug-fix: use self for tree output

For action "tree" was used old code from unit controller. Rewritten and used method "roots" for getting array of root nodes.