 
     func testListClassifiers() {
         let expectation = self.expectation(description: "Get classifiers.")
-        naturalLanguageClassifier.listClassifiers(failure: failWithError) { classifiers in
+        naturalLanguageClassifier.listClassifiers() {
+            response, error in
+
+            if let error = error {
+                XCTFail("Unexpected error response from service: \(error)")
+                return
+            }
+            guard let classifiers = response?.result else {
+                XCTFail("Missing response value")
+                return
+            }
+
             XCTAssertGreaterThan(classifiers.classifiers.count, 0)
             expectation.fulfill()
         }


    func testCreateAndDelete() {
        let expectation = self.expectation(description: "Create and delete a classifier")
        naturalLanguageClassifier.createClassifier(metadata: metadataFile, trainingData: trainingFile, failure: failWithError) {
            classifier in
            XCTAssertEqual(classifier.name, self.temporaryClassifierName)
            XCTAssertEqual(classifier.language, "en")
            self.naturalLanguageClassifier.deleteClassifier(classifierID: classifier.classifierID, failure: self.failWithError) {
                expectation.fulfill()
            }
        }


    func testCreateClassifierWithMissingMetadata() {
        let expectation = self.expectation(description: "Create a classifier with missing metadata")
        naturalLanguageClassifier.createClassifier(
            metadata: metadataFileEmpty,
            trainingData: trainingFile
        ) {
                _, error in

                if error == nil {
                    XCTFail("Expected error response")
                }
                expectation.fulfill()
        }
        waitForExpectations()
    }

    func testClassifyEmptyString() {
        let expectation = self.expectation(description: "Classify and empty string.")
        naturalLanguageClassifier.classify(classifierID: trainedClassifierId, text: "") {
            _, error in

            if error == nil {
                XCTFail("Expected error response")
            }
            expectation.fulfill()
        }
        waitForExpectations()
    }

    func testClassifyWithInvalidClassifier() {
        let expectation = self.expectation(description: "Classify using an invalid classifier id.")
        naturalLanguageClassifier.classify(
            classifierID: "this-is-an-invalid-classifier-id",
            text: "How hot will it be today?"
        ) {
            _, error in

            if error == nil {
                XCTFail("Expected error response")
            }
            expectation.fulfill()
        }
        waitForExpectations()
    }

    func testDeleteInvalidClassifier() {
        let expectation = self.expectation(description: "Delete a classifier using an invalid classifier id.")
        naturalLanguageClassifier.deleteClassifier(
            classifierID: "this-is-an-invalid-classifier-id"
        ) {
            _, error in

            if error == nil {
                XCTFail("Expected error response")
            }
            expectation.fulfill()
        }
        waitForExpectations()
    }

    func testGetInvalidClassifier() {
        let expectation = self.expectation(description: "Get classifier using an invalid classifier id.")
        naturalLanguageClassifier.getClassifier(
            classifierID: "this-is-an-invalid-classifier-id"
        ) {
            _, error in

            if error == nil {
                XCTFail("Expected error response")
            }
            expectation.fulfill()
        }
        waitForExpectations()
    }
}
