Improved JSON lazy extraction and error handling