                         Logger.error("Error converting headers to JSON - \(err.localizedDescription)")
                     } else if let d = data {
                         if let json = NSString(data: d, encoding: NSUTF8StringEncoding) {
-                            addParamValue(value: json)
+                            addParamValue(value: json as String)
                         }
                     }
                 } else if let value = paramValue as? String {

                    if self.toname == nil {
                        self.toname = []
                    }
                    if countElements(addresses) == countElements(toNames) {
                        self.toname! += toNames
                    } else {
                        Logger.error("SendGrid addTos: The number of email addresses provided didn't match the number of names provided.")

        
        addToParamsIfPresent("fromname", email.fromname)
        
        if email.hasRecipientsInSmtpApi && email.smtpapi.to != nil && count(email.smtpapi.to!) > 0 {
            params["to"] = email.from!
        } else if !email.hasRecipientsInSmtpApi && email.to != nil && count(email.to!) > 0 {
            params["to"] = email.to!
        } else {
            Logger.error("SendGrid send: Could not send message as no recipients were specified.")
