 
         let responseGenerator = ResponseGenerator(standardResponse: response.standardResponse)
         guard let jsonData = try? responseGenerator.generateJSON(options: .prettyPrinted) else {
-            return .failure(message: "Error generating response")
+            completion(.failure(error: Error(message: "Error generating response")))
+            return
         }
         
-        return .success(data: jsonData)
+        completion(.success(data: jsonData))
     }
 }

        self.requestHandler = requestHandler
    }

    open func dispatch(fileHandle: FileHandle) -> Result {
        return dispatch(data: fileHandle.readDataToEndOfFile())
    }

    open func dispatch(data: Data) -> Result {
        guard let requestParser = try? RequestParser(with: data),
            let requestType = requestParser.parseRequestType() else {
                return .failure(message: "Error parsing request")
        }

        var response = (standardResponse: StandardResponse(), sessionAttributes: [:])

        case .intent:
            guard let intentRequest = requestParser.parseIntentRequest(),
                let session = requestParser.parseSession() else {
                completion(.failure(error: Error(message: "Error parsing intent")))
                return
            }

            requestHandler.handleIntent(request: intentRequest, session: session, next: { (standardResponse) in
