             throw CIOError.invalidResponse
         }
 
-        
+
         let results = self.jsonToAutocompleteItems(jsonObjects: section)
         var metadata = json
         metadata[Constants.Response.singleSectionResultField] = nil

struct CIOAutocompleteResponseParser: AbstractResponseParser {

    weak var delegate: ResponseParserDelegate?
    
    func parse(autocompleteResponseData: Data) throws -> CIOAutocompleteResponse {
        do {
            let json = try JSONSerialization.jsonObject(with: autocompleteResponseData) as! JSONObject
            let isSingleSection = json.keys.contains(Constants.Response.singleSectionResultField)
            
            return isSingleSection ? try parse(singleSectionJson: json) : try parse(multiSectionJson: json)
        } catch {
            throw CIOError.invalidResponse

        }

        var results = [String: [CIOResult]]()

        for section in sections{
            if self.delegate?.shouldParseResults(inSectionWithName: section.key) ?? true{
                results[section.key] = self.jsonToAutocompleteItems(jsonObjects: section.value)
