Index: src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java	(revision 6513)
+++ src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java	(revision 6514)
@@ -157,9 +157,6 @@
             
             // get the rest of the path info
             String extra = null;
-            if (resource.lastIndexOf("/") != -1) {
-                extra = resource.substring(resource.lastIndexOf("/") + 1);
-            }
                         
             logMetacat.debug("handling verb " + httpVerb + " request with resource '" + resource + "'");
             logMetacat.debug("resource: '" + resource + "'");
@@ -173,13 +170,17 @@
                     status = true;
                 } else if (resource.startsWith(RESOURCE_ACCESS_RULES)) {
                     if (httpVerb == POST) {
+                    	// after the command
+                        extra = parseTrailing(resource, RESOURCE_ACCESS_RULES);
 	                	// set the access rules
-	                    setAccess();
+	                    setAccess(extra);
 	                    status = true;
 	                    logMetacat.debug("done setting access");
                     }
                 } else if (resource.startsWith(RESOURCE_IS_AUTHORIZED)) {
                     if (httpVerb == GET) {
+                    	// after the command
+                        extra = parseTrailing(resource, RESOURCE_IS_AUTHORIZED);
 	                	// check the access rules
 	                    isAuthorized(extra);
 	                    status = true;
@@ -189,6 +190,8 @@
                     logMetacat.debug("Using resource 'meta'");
                     // get
                     if (httpVerb == GET) {
+                    	// after the command
+                        extra = parseTrailing(resource, RESOURCE_META);
                         getSystemMetadataObject(extra);
                         status = true;
                     }
@@ -195,7 +198,8 @@
                     
                 } else if (resource.startsWith(RESOURCE_OBJECTS)) {
                     logMetacat.debug("Using resource 'object'");
-                    
+                    // after the command
+                    extra = parseTrailing(resource, RESOURCE_OBJECTS);
                     logMetacat.debug("objectId: " + extra);
                     logMetacat.debug("verb:" + httpVerb);
 
@@ -227,6 +231,8 @@
                     logMetacat.debug("Using resource 'checksum'");
                     // handle checksum requests
                     if (httpVerb == GET) {
+                    	// after the command
+                        extra = parseTrailing(resource, RESOURCE_CHECKSUM);
                         checksum(extra);
                         status = true;
                     }
@@ -233,6 +239,8 @@
                 } else if (resource.startsWith(RESOURCE_MONITOR)) {
                     // there are various parts to monitoring
                     if (httpVerb == GET) {
+                    	// after the command
+                        extra = parseTrailing(resource, RESOURCE_MONITOR);
                     	// health monitoring calls
                         status = monitor(extra);
                     }
@@ -330,46 +338,7 @@
 		MNodeService.getInstance().synchronizationFailed(session, syncFailed);
     }
     
-    protected SynchronizationFailed collectSynchronizationFailed() throws IOException, ServiceFailure, InvalidRequest, JiBXException, InstantiationException, IllegalAccessException, ParserConfigurationException, SAXException  {
-		
-		// Read the incoming data from its Mime Multipart encoding
-		logMetacat.debug("Disassembling MIME multipart form");
-		InputStream sf = null;
 
-		// handle MMP inputs
-		File tmpDir = getTempDirectory();
-		logMetacat.debug("temp dir: " + tmpDir.getAbsolutePath());
-		MultipartRequestResolver mrr = 
-			new MultipartRequestResolver(tmpDir.getAbsolutePath(), 1000000000, 0);
-		MultipartRequest mr = null;
-		try {
-			mr = mrr.resolveMultipart(request);
-		} catch (Exception e) {
-			throw new ServiceFailure("2161", 
-					"Could not resolve multipart: " + e.getMessage());
-		}
-		logMetacat.debug("resolved multipart request");
-		Map<String, File> files = mr.getMultipartFiles();
-		if (files == null || files.keySet() == null) {
-			throw new InvalidRequest("2163",
-					"must have multipart file with name 'message'");
-		}
-		logMetacat.debug("got multipart files");
-
-		multipartparams = mr.getMultipartParameters();
-
-		File sfFile = files.get("message");
-		if (sfFile == null) {
-			throw new InvalidRequest("2163",
-					"Missing the required file-part 'message' from the multipart request.");
-		}
-		logMetacat.debug("sfFile: " + sfFile.getAbsolutePath());
-		sf = new FileInputStream(sfFile);
-	
-		SynchronizationFailed syncFailed = (SynchronizationFailed) ExceptionHandler.deserializeXml(sf, "Error deserializing exception");
-		return syncFailed;
-	}
-
     /**
      * Handles the monitoring resources
      * @return
@@ -973,18 +942,60 @@
      * @throws IllegalAccessException 
      * @throws InstantiationException 
      * @throws IOException 
+     * @throws SAXException 
+     * @throws ParserConfigurationException 
      */
-    protected void setAccess() throws JiBXException, InvalidToken, ServiceFailure, NotFound, NotAuthorized, NotImplemented, InvalidRequest, IOException, InstantiationException, IllegalAccessException
+    protected void setAccess(String pid) throws JiBXException, InvalidToken, ServiceFailure, NotFound, NotAuthorized, NotImplemented, InvalidRequest, IOException, InstantiationException, IllegalAccessException, ParserConfigurationException, SAXException
     {
     
-        String pid = params.get("pid")[0];
+        //String pid = params.get("pid")[0];
         Identifier id = new Identifier();
         id.setValue(pid);
-        String accesspolicy = params.get("accesspolicy")[0];
-        AccessPolicy accessPolicy = TypeMarshaller.unmarshalTypeFromStream(AccessPolicy.class, new ByteArrayInputStream(accesspolicy.getBytes("UTF-8")));
+        
+        AccessPolicy accessPolicy = collectAccessPolicy();
         MNodeService.getInstance().setAccessPolicy(session, id, accessPolicy);
         
         
     }
 
+	protected SynchronizationFailed collectSynchronizationFailed() throws IOException, ServiceFailure, InvalidRequest, JiBXException, InstantiationException, IllegalAccessException, ParserConfigurationException, SAXException  {
+		
+		// Read the incoming data from its Mime Multipart encoding
+		logMetacat.debug("Disassembling MIME multipart form");
+		InputStream sf = null;
+	
+		// handle MMP inputs
+		File tmpDir = getTempDirectory();
+		logMetacat.debug("temp dir: " + tmpDir.getAbsolutePath());
+		MultipartRequestResolver mrr = 
+			new MultipartRequestResolver(tmpDir.getAbsolutePath(), 1000000000, 0);
+		MultipartRequest mr = null;
+		try {
+			mr = mrr.resolveMultipart(request);
+		} catch (Exception e) {
+			throw new ServiceFailure("2161", 
+					"Could not resolve multipart: " + e.getMessage());
+		}
+		logMetacat.debug("resolved multipart request");
+		Map<String, File> files = mr.getMultipartFiles();
+		if (files == null || files.keySet() == null) {
+			throw new InvalidRequest("2163",
+					"must have multipart file with name 'message'");
+		}
+		logMetacat.debug("got multipart files");
+	
+		multipartparams = mr.getMultipartParameters();
+	
+		File sfFile = files.get("message");
+		if (sfFile == null) {
+			throw new InvalidRequest("2163",
+					"Missing the required file-part 'message' from the multipart request.");
+		}
+		logMetacat.debug("sfFile: " + sfFile.getAbsolutePath());
+		sf = new FileInputStream(sfFile);
+	
+		SynchronizationFailed syncFailed = (SynchronizationFailed) ExceptionHandler.deserializeXml(sf, "Error deserializing exception");
+		return syncFailed;
+	}
+
 }
Index: src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java	(revision 6513)
+++ src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java	(revision 6514)
@@ -34,6 +34,7 @@
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.commons.fileupload.FileUploadException;
 import org.apache.commons.io.IOUtils;
@@ -65,6 +66,7 @@
 import org.dataone.service.util.DateTimeMarshaller;
 import org.dataone.service.util.TypeMarshaller;
 import org.jibx.runtime.JiBXException;
+import org.xml.sax.SAXException;
 
 import edu.ucsb.nceas.metacat.dataone.CNodeService;
 
@@ -150,7 +152,9 @@
 
                 if (resource.startsWith(RESOURCE_ACCESS_RULES) && httpVerb == PUT) {
                     logMetacat.debug("Setting access policy");
-                    setAccess();
+                    // after the command
+                    extra = parseTrailing(resource, RESOURCE_ACCESS_RULES);
+                    setAccess(extra);
                     status = true;
                     logMetacat.debug("done setting access");
                     
@@ -308,23 +312,6 @@
         }
     }
     
-    private String parseTrailing(String resource, String token) {
-    	// get the rest
-        String extra = null;
-        if (resource.indexOf(token) != -1) {
-        	// what comes after the token?
-            extra = resource.substring(resource.indexOf(token) + token.length());
-            // remove the slash
-            if (extra.startsWith("/")) {
-            	extra = extra.substring(1);
-            }
-            // is there anything left?
-            if (extra.length() == 0) {
-            	extra = null;
-            }
-        }
-        return extra;
-    }
     
     /**
      * Get the checksum for the given guid
@@ -787,14 +774,15 @@
      * @throws IllegalAccessException 
      * @throws InstantiationException 
      * @throws IOException 
+     * @throws SAXException 
+     * @throws ParserConfigurationException 
      */
-    protected void setAccess() throws JiBXException, InvalidToken, ServiceFailure, NotFound, NotAuthorized, NotImplemented, InvalidRequest, IOException, InstantiationException, IllegalAccessException {
+    protected void setAccess(String pid) throws JiBXException, InvalidToken, ServiceFailure, NotFound, NotAuthorized, NotImplemented, InvalidRequest, IOException, InstantiationException, IllegalAccessException, ParserConfigurationException, SAXException {
 
-        String guid = params.get("guid")[0];
         Identifier id = new Identifier();
-        id.setValue(guid);
-        String accesspolicy = params.get("accesspolicy")[0];
-        AccessPolicy accessPolicy = TypeMarshaller.unmarshalTypeFromStream(AccessPolicy.class, new ByteArrayInputStream(accesspolicy.getBytes("UTF-8")));
+        id.setValue(pid);
+        
+        AccessPolicy accessPolicy = collectAccessPolicy();
         CNodeService.getInstance().setAccessPolicy(session, id, accessPolicy);
 
     }
Index: src/edu/ucsb/nceas/metacat/restservice/D1ResourceHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/restservice/D1ResourceHandler.java	(revision 6513)
+++ src/edu/ucsb/nceas/metacat/restservice/D1ResourceHandler.java	(revision 6514)
@@ -24,26 +24,21 @@
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PrintWriter;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.TimeZone;
 import java.util.Timer;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.commons.fileupload.FileUploadException;
 import org.apache.commons.io.IOUtils;
@@ -54,10 +49,12 @@
 import org.dataone.service.exceptions.BaseException;
 import org.dataone.service.exceptions.InvalidRequest;
 import org.dataone.service.exceptions.ServiceFailure;
+import org.dataone.service.types.v1.AccessPolicy;
 import org.dataone.service.types.v1.Session;
 import org.dataone.service.types.v1.SystemMetadata;
 import org.dataone.service.util.TypeMarshaller;
 import org.jibx.runtime.JiBXException;
+import org.xml.sax.SAXException;
 
 import edu.ucsb.nceas.metacat.MetacatHandler;
 import edu.ucsb.nceas.metacat.properties.PropertyService;
@@ -148,6 +145,64 @@
         }
     }
     
+    protected String parseTrailing(String resource, String token) {
+    	// get the rest
+        String extra = null;
+        if (resource.indexOf(token) != -1) {
+        	// what comes after the token?
+            extra = resource.substring(resource.indexOf(token) + token.length());
+            // remove the slash
+            if (extra.startsWith("/")) {
+            	extra = extra.substring(1);
+            }
+            // is there anything left?
+            if (extra.length() == 0) {
+            	extra = null;
+            }
+        }
+        return extra;
+    }
+    
+    protected AccessPolicy collectAccessPolicy() throws IOException, ServiceFailure, InvalidRequest, JiBXException, InstantiationException, IllegalAccessException, ParserConfigurationException, SAXException  {
+		
+		// Read the incoming data from its Mime Multipart encoding
+		logMetacat.debug("Disassembling MIME multipart form");
+		InputStream ap = null;
+
+		// handle MMP inputs
+		File tmpDir = getTempDirectory();
+		logMetacat.debug("temp dir: " + tmpDir.getAbsolutePath());
+		MultipartRequestResolver mrr = 
+			new MultipartRequestResolver(tmpDir.getAbsolutePath(), 1000000000, 0);
+		MultipartRequest mr = null;
+		try {
+			mr = mrr.resolveMultipart(request);
+		} catch (Exception e) {
+			throw new ServiceFailure("2161", 
+					"Could not resolve multipart: " + e.getMessage());
+		}
+		logMetacat.debug("resolved multipart request");
+		Map<String, File> files = mr.getMultipartFiles();
+		if (files == null || files.keySet() == null) {
+			throw new InvalidRequest("2163",
+					"must have multipart file with name 'accessPolicy'");
+		}
+		logMetacat.debug("got multipart files");
+
+		multipartparams = mr.getMultipartParameters();
+
+		File apFile = files.get("accessPolicy");
+		if (apFile == null) {
+			throw new InvalidRequest("2163",
+					"Missing the required file-part 'accessPolicy' from the multipart request.");
+		}
+		logMetacat.debug("apFile: " + apFile.getAbsolutePath());
+		ap = new FileInputStream(apFile);
+	
+		AccessPolicy accessPolicy = TypeMarshaller.unmarshalTypeFromStream(AccessPolicy.class, ap);
+		return accessPolicy;
+	}
+    
     protected SystemMetadata collectSystemMetadata() throws IOException, FileUploadException, ServiceFailure, InvalidRequest, JiBXException, InstantiationException, IllegalAccessException  {
 		
 		// Read the incoming data from its Mime Multipart encoding
