Refactor API into a class
Handle final slash
Rework tree
Do not compile .static