 
     func testGetModel() {
         let expectation = self.expectation(description: "Get model.")
-        languageTranslator.getModel(modelID: "en-es", failure: failWithError) { model in
+        languageTranslator.getModel(modelID: "en-es") {
+            response, error in
+
+            if let error = error {
+                XCTFail("Unexpected error response from service: \(error)")
+                return
+            }
+            guard let model = response?.result else {
+                XCTFail("Missing response value")
+                return
+            }
+
             XCTAssertEqual(model.status, TranslationModel.Status.available.rawValue)
             expectation.fulfill()
         }


    func testListModelsAll() {
        let expectation = self.expectation(description: "List all models.")
        languageTranslator.listModels(failure: failWithError) { models in
            XCTAssertGreaterThan(models.models.count, 0)
            expectation.fulfill()
        }

    func testTranslateStringWithModelID() {
        let expectation = self.expectation(description: "Translate text string using model id.")
        let request = TranslateRequest(text: ["Hello"], modelID: "en-es")
        languageTranslator.translate(request: request) {
            response, error in

            if let error = error {
                XCTFail("Unexpected error response from service: \(error)")
                return
            }
            guard let translation = response?.result else {
                XCTFail("Missing response value")
                return
            }

            XCTAssertEqual(translation.wordCount, 1)
            XCTAssertEqual(translation.characterCount, 5)
            XCTAssertEqual(translation.translations.count, 1)
