                 }
                 next()
             }
+            
+        } catch {
+            Log.error("Failed to send response \(error)")
         }
-
     }
     
     private func handleTemperature(request: RouterRequest, response: RouterResponse, next: ()->Void ) {

    
    private func handleAskWatson(request: RouterRequest, response: RouterResponse, next: ()->Void ) {
        
        var requestDecoded: SlackRequest?
        
        do {
            var readstring = try request.readString()
            requestDecoded = SlackRequest(payload: readstring!)
            guard let token = requestDecoded?.token else {
                try response.status(.forbidden).send("forbidden").end()
                next()
                return
            }
            
            Log.info("Received \(requestDecoded)")
            guard token == Configuration.slackToken else {
                try response.status(.forbidden).send("forbidden").end()
                next()
                return
            }
        } catch {
            Log.error("Failed to send response \(error)")
            
        }
        
        if let requestDecoded = requestDecoded {
            do {
                let acknowledge = "Hi @\(requestDecoded.userName!)! I see you have a question. Let's see what I can find for you."
                // try respondToSlack(response: acknowledge, requestDecode: requestDecoded)
                // try response.status(.OK).end()
            } catch {
                Log.error("Failed to send response \(error)")
            }
            
            getClassifyTopClass(text: requestDecoded.text!) { topClass in
                
                do {


import Foundation
import Kitura
import LoggerAPI


class WatsonWeatherBot {
    
