Fixed JSON to tree nodes implementation and created test