Move JSON::Parse error detection and support empty JSON data as nil