API that allows create trees with php classes as nodes