     func requestDELETE(url: NSURL) -> Request {
         let req = NSMutableURLRequest(URL: url)
         req.HTTPMethod = Method.DELETE.rawValue
-        req.addValue("1", forHTTPHeaderField: "X-Confirm-Delete")
+        req.setValue("1", forHTTPHeaderField: "X-Confirm-Delete")
         let authorized: NSMutableURLRequest = self.authorizer(req)
+        return Alamofire.request(authorized)
+    }
+
+    func requestPUT(url: NSURL, body: JSON, ifUnmodifiedSince: Timestamp?) -> Request {
+        let req = NSMutableURLRequest(URL: url)
+        req.HTTPMethod = Method.PUT.rawValue
+        req.setValue("application/json", forHTTPHeaderField: "Content-Type")
+        let authorized: NSMutableURLRequest = self.authorizer(req)
+
+        if let ifUnmodifiedSince = ifUnmodifiedSince {
+            req.setValue(millisecondsToDecimalSeconds(ifUnmodifiedSince), forHTTPHeaderField: "X-If-Unmodified-Since")
+        }
+
+        req.HTTPBody = body.toString(pretty: false).dataUsingEncoding(NSUTF8StringEncoding)!
         return Alamofire.request(authorized)
     }
 
     private func doOp<T>(op: (NSURL) -> Request, path: String, f: (JSON) -> T?) -> Deferred<Result<StorageResponse<T>>> {
         let deferred = Deferred<Result<StorageResponse<T>>>(defaultQueue: self.resultQueue)
         let req = op(self.serverURI.URLByAppendingPathComponent(path))
-        req.responseParsedJSON(errorWrap(deferred, { (_, response, data, error) in
+        let handler = errorWrap(deferred, { (_, response, data, error) in
             if let json: JSON = data as? JSON {
                 if let v = f(json) {
                     let storageResponse = StorageResponse<T>(value: v, response: response!)

import Alamofire
import Shared
import Account

// Not an error that indicates a server problem, but merely an
// error that encloses a StorageResponse.

    func requestGET(url: NSURL) -> Request {
        let req = NSMutableURLRequest(URL: url)
        req.HTTPMethod = Method.GET.rawValue
        req.setValue("application/json", forHTTPHeaderField: "Accept")
        let authorized: NSMutableURLRequest = self.authorizer(req)
        return Alamofire.request(authorized)
                        .validate(contentType: ["application/json"])
