         )
 
         // execute REST request
-        request.responseObject {
-            (response: RestResponse<ToneAnalysis>) in
-            switch response.result {
-            case .success(let retval): success(retval)
-            case .failure(let error): failure?(error)
-            }
-        }
+        request.responseObject(completionHandler: completionHandler)
     }
 
     /**

        )

        // execute REST request
        request.responseObject {
            (response: RestResponse<UtteranceAnalyses>) in
            switch response.result {
            case .success(let retval): success(retval)
            case .failure(let error): failure?(error)
            }
        }
    }

}

extension ToneAnalyzer {

    @available(*, deprecated, message: "This method has been deprecated in favor of the tone method that accepts a toneContent parameter.  This method will be removed in a future release.")
    public func tone(
        toneInput: ToneInput,
        sentences: Bool? = nil,
        tones: [String]? = nil,
        contentLanguage: String? = nil,
        acceptLanguage: String? = nil,
        headers: [String: String]? = nil,
        failure: ((Error) -> Void)? = nil,
        success: @escaping (ToneAnalysis) -> Void)
    {
        tone(toneContent: .toneInput(toneInput), sentences: sentences, tones: tones, contentLanguage: contentLanguage,
             acceptLanguage: acceptLanguage, headers: headers, failure: failure, success: success)
    }

    @available(*, deprecated, message: "This method has been deprecated in favor of the tone method that accepts a toneContent parameter.  This method will be removed in a future release.")
    public func tone(
        text: String,
        sentences: Bool? = nil,
        tones: [String]? = nil,
        contentLanguage: String? = nil,
        acceptLanguage: String? = nil,
        headers: [String: String]? = nil,
        failure: ((Error) -> Void)? = nil,
        success: @escaping (ToneAnalysis) -> Void)
    {
        tone(toneContent: .text(text), sentences: sentences, tones: tones, contentLanguage: contentLanguage,
             acceptLanguage: acceptLanguage, headers: headers, failure: failure, success: success)
    }

    @available(*, deprecated, message: "This method has been deprecated in favor of the tone method that accepts a toneContent parameter.  This method will be removed in a future release.")
    public func tone(
        html: String,
        sentences: Bool? = nil,
        tones: [String]? = nil,
        contentLanguage: String? = nil,
        acceptLanguage: String? = nil,
        headers: [String: String]? = nil,
        failure: ((Error) -> Void)? = nil,
        success: @escaping (ToneAnalysis) -> Void)
    {
        tone(toneContent: .html(html), sentences: sentences, tones: tones, contentLanguage: contentLanguage,
             acceptLanguage: acceptLanguage, headers: headers, failure: failure, success: success)
    }

}

       are treated as their parent language; for example, `en-US` is interpreted as `en`. You can use different
       languages for **Content-Language** and **Accept-Language**.
     - parameter headers: A dictionary of request headers to be sent with this request.
     - parameter completionHandler: A function executed when the request completes with a successful result or error
     */
    public func toneChat(
        utterances: [Utterance],
        contentLanguage: String? = nil,
        acceptLanguage: String? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<UtteranceAnalyses>?, Error?) -> Void)
    {
        // construct body
        let toneChatRequest = ToneChatInput(utterances: utterances)
        guard let body = try? JSONEncoder().encode(toneChatRequest) else {
            completionHandler(nil, RestError.serializationError)
            return
        }

