Improved JSON loading and error messages