Implement unit tests for JSON error handling