                         completionHandler(transcript, nil)
                     } catch let error {
                         let message = "Error parsing JSON: \(error)"
-                        self.asynchronousError(function, message: message, code: postStatusCode!, completionHandler: completionHandler)
+                        self.asynchronousError(function, message: message, code: postStatusCode, completionHandler: completionHandler)
                         return
                     }
 

                let getStatusCode = (response as? NSHTTPURLResponse)?.statusCode
                guard getStatusCode == 200 else {
                    let message = "HTTP error code returned for GET request."
                    self.asynchronousError(function, message: message, code: getStatusCode!, completionHandler: completionHandler)
                    return
                }
                

    /**
    An abstraction of a common pattern for handling asynchronous errors.
    */
    private func asynchronousError(function: String, message: String, code: Int?, completionHandler: (String?, NSError?) -> Void) {
        
        WatsonError("\(function): \(message)")
        let userInfo = [NSLocalizedDescriptionKey: message]
        let codeUnwrapped: Int
        if let code = code {
            codeUnwrapped = code
        } else {
            codeUnwrapped = 0
        }
        let error = NSError(domain: "WatsonSpeechToText", code: codeUnwrapped, userInfo: userInfo)
        completionHandler(nil, error)
        
    }
    
    /**
