in the middle of modify json to match tree