anchor.diff:                             ;; status codes CouchDB might return.
                              (error "Unknown status code: ~A. HTTP Response: ~A"
                                     status-code response)))))
  -  (:reply :around ((server =json-server=) &rest all-keys &key (content nil contentp))
  +  (:reply :around ((server =json-server=) uri &rest all-keys &key (content nil contentp))
       "This special :around reply wraps the standard =server= reply and encodes/decodes JSON
   where appropriate, which makes for a nicer Lisp-side API."
       (multiple-value-bind (response status-code)
  -        (apply #'call-next-reply server :content (when contentp (ensure-json content)) all-keys)
  +        (apply #'call-next-reply server uri :content (when contentp (ensure-json content)) all-keys)
         (values (json-to-document response) status-code))))
   
   (defun all-dbs (server)
     "Requests a list of all existing databases from SERVER."
  -  (couch-request server :uri "_all_dbs"))
  +  (couch-request server "_all_dbs"))
   
   (defun config-info (server)
     "Requests the current configuration from SERVER."
  -  (couch-request server :uri "_config"))
  +  (couch-request server "_config"))
   
   (defun replicate (server source target)
     "Replicates the database in SOURCE to TARGET. SOURCE and TARGET can both be either database names
  
positive.code: (defmessage db-request (db &key)
    (:documentation "Sends a CouchDB request to DB.")
    (:reply ((db =database=) &rest all-keys &key (uri ""))
      (apply #'couch-request (server db) :uri (strcat (name db) "/" uri) all-keys)))
  
  (defmacro handle-request ((result-var request) &body expected-responses)
    "Provides a nice interface to the relatively manual, low-level status-code checking that
  
negative.code: 
  (defun stats (server)
    "Requests general statistics from SERVER."
    (couch-request server "_stats"))
  
  (defun active-tasks (server)
    "Lists all the currently active tasks on SERVER."
    (couch-request server "_active_tasks"))
  
  (defun get-uuids (server &key (number 10))
    "Returns a list of NUMBER unique IDs requested from SERVER. The UUIDs generated by the server
  are reasonably unique, but are not checked against existing UUIDs, so conflicts may still happen."
    (couch-request server (format nil "_uuids?count=~A" number)))
  
  ;;;
  ;;; Basic database API
  