     var fromname: String?
     var text: String?
     var html: String?
-    var headers = []
+    var headers: [String:String]?
     var cc: [String]?
     var bcc: [String]?
     var replyto: String?

        self.setHtmlBody(html)
    }
    
    func send(completionHandler: ((NSURLResponse!, NSData!, NSError!) -> Void)?) {
        let url = NSURL(string: "https://api.sendgrid.com/api/mail.send.json")!
        let request = NSMutableURLRequest(URL: url)

        addToParamsIfPresent("cc", self.cc)
        addToParamsIfPresent("bcc", self.bcc)
        addToParamsIfPresent("replyto", self.replyto)
        addToParamsIfPresent("headers", self.headers)
        
        var body = ""
        for (paramName, paramValue) in params {
            if paramName == "headers" {
                if countElements(body) > 0 { body += "&" }
                var error: NSError?
                var data = NSJSONSerialization.dataWithJSONObject(paramValue, options: nil, error: &error)
                if let err = error {
                    Logger.error("Error converting headers to JSON - \(err.localizedDescription)")
                } else if let d = data {
                    if let json = NSString(data: d, encoding: NSUTF8StringEncoding) {
                        if let encoded = json.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding) {
                            body += "headers=\(encoded)"
                        }
                    }
                }
            }else if let arr = paramValue as? [String] {
                for value in arr {
                    if let encoded = value.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding) {
                        if countElements(body) > 0 { body += "&" }
