Rewrite directory tree
Add API