         let description = "Get details of a specific entity."
         let expectation = self.expectation(description: description)
 
-        conversation.listEntities(workspaceID: workspaceID, failure: failWithError) {entityCollection in
+        conversation.listEntities(workspaceID: workspaceID) {
+            response, error in
+
+            if let error = error {
+                XCTFail("Unexpected error response from service: \(error)")
+                return
+            }
+            guard let entityCollection = response?.result else {
+                XCTFail("Missing response value")
+                return
+            }
+
             XCTAssert(entityCollection.entities.count > 0)
             let entity = entityCollection.entities[0]
-            self.conversation.getEntity(workspaceID: self.workspaceID, entity: entity.entityName, export: true, includeAudit: true, failure: self.failWithError) { entityExport in
+            self.conversation.getEntity(workspaceID: self.workspaceID, entity: entity.entityName, export: true, includeAudit: true) {
+                response, error in
+
+                if let error = error {
+                    XCTFail("Unexpected error response from service: \(error)")
+                    return
+                }
+                guard let entityExport = response?.result else {
+                    XCTFail("Missing response value")
+                    return
+                }
+
                 XCTAssertEqual(entityExport.entityName, entity.entityName)
                 XCTAssertEqual(entityExport.description, entity.description)
                 XCTAssertNotNil(entityExport.created)


        let input2 = InputData(text: "Turn on the radio.")
        let request2 = MessageRequest(input: input2, context: context, entities: entities, intents: intents, output: output)
        conversation.message(workspaceID: workspaceID, request: request2, failure: failWithError) {
            response in
            context = response.context
            entities = response.entities
            intents = response.intents
            output = response.output
            expectation2.fulfill()
        }
        waitForExpectations()

        let description2 = "Delete the new intent."
        let expectation2 = self.expectation(description: description2)

        conversation.deleteIntent(workspaceID: workspaceID, intent: newIntentName) {
            _, error in

            if let error = error {
                XCTFail("Unexpected error response from service: \(error)")
            }
            expectation2.fulfill()
        }
        waitForExpectations()
