generating json screens with tree structure