Loadtree bugfixes and error message if json is not valid