Index: server/lib/gutenbach/ipp/request.py
===================================================================
--- server/lib/gutenbach/ipp/request.py	(revision 9eeab0608a8627581e9522549d62511f379a1d59)
+++ server/lib/gutenbach/ipp/request.py	(revision 7bd1035512a62917148a585e099d7632eee2a5c8)
@@ -238,5 +238,5 @@
 
     def __repr__(self):
-        val = '<IPPRequest (version=%r, ' % self.version
+        val = '<IPPRequest (version=%r, ' % [self.version]
         val += 'operation_id=%x, ' % self.operation_id
         val += 'request_id=%r, ' % self.request_id
Index: server/lib/gutenbach/server/__init__.py
===================================================================
--- server/lib/gutenbach/server/__init__.py	(revision b2e077a94f58512ca52085a59f40ffecab7178d5)
+++ server/lib/gutenbach/server/__init__.py	(revision 7bd1035512a62917148a585e099d7632eee2a5c8)
@@ -1,8 +1,8 @@
-from requests import GutenbachIPPServer
+from server import GutenbachIPPServer
 import BaseHTTPServer
 import logging
 
 # configure logging
-logging.basicConfig(level=logging.DEBUG)
+logging.basicConfig(level=logging.INFO)
 
 def start():
Index: server/lib/gutenbach/server/requests.py
===================================================================
--- server/lib/gutenbach/server/requests.py	(revision 0ede474725e1fe1ad31ff30ee71f9002b66051d2)
+++ server/lib/gutenbach/server/requests.py	(revision 7bd1035512a62917148a585e099d7632eee2a5c8)
@@ -1,3 +1,2 @@
-import BaseHTTPServer
 import gutenbach.ipp as ipp
 import gutenbach.ipp.constants as const
@@ -42,5 +41,5 @@
         # call the handler
         handler = getattr(self, handler_name)
-        logger.debug("Sending request to handler '%s'" % handler_name)
+        logger.info("Handling request of type '%s'" % handler_name)
         handler(request, response)
 
@@ -105,5 +104,4 @@
         for job in self.printers[printer_name].get_jobs():
             self._get_job_attributes(job, request, response)
-        response.operation_id = const.StatusCodes.OK
 
     def print_uri(self, request, response):
@@ -125,5 +123,4 @@
         printer_name = self._get_printer_name(request)
         self._get_printer_attributes(self.printers[printer_name], request, response)
-        response.operation_id = const.StatusCodes.OK
 
     def set_printer_attributes(self, request, response):
@@ -209,5 +206,4 @@
             
         self._get_printer_attributes(self.printers[self.default], request, response)
-        response.operation_id = const.StatusCodes.OK
 
     @handler_for(const.Operations.CUPS_GET_PRINTERS)
@@ -282,5 +278,4 @@
         for printer in self.printers:
             self._get_printer_attributes(self.printers[printer], request, response)
-        response.operation_id = const.StatusCodes.OK
 
     @handler_for(const.Operations.CUPS_GET_CLASSES)
@@ -354,57 +349,3 @@
         
         # We have no printer classes, so we don't need to do anything
-        response.operation_id = const.StatusCodes.OK
-
-class GutenbachIPPServer(BaseHTTPServer.BaseHTTPRequestHandler):
-    def setup(self):
-        self.root = GutenbachRequestHandler()
-        BaseHTTPServer.BaseHTTPRequestHandler.setup(self)
-
-    def handle_one_request(self):
-        self.raw_requestline = self.rfile.readline()
-        if not self.raw_requestline:
-            self.close_connection = 1
-            return
-        if not self.parse_request(): # An error code has been sent, just exit
-            return
-        self.handle_ipp()
-
-    def handle_ipp(self):
-        # Receive a request
-        length = int(self.headers.getheader('content-length', 0))
-        request = ipp.Request(request=self.rfile, length=length)
-        logger.debug("Received request: %s" % repr(request))
-
-        # Operation attributes -- typically the same for any request
-        attributes = [
-            ipp.Attribute(
-                'attributes-charset',
-                [ipp.Value(ipp.Tags.CHARSET, 'utf-8')]),
-            ipp.Attribute(
-                'attributes-natural-language',
-                [ipp.Value(ipp.Tags.NATURAL_LANGUAGE, 'en-us')])
-            ]
-        # Put the operation attributes in a group
-        attribute_group = ipp.AttributeGroup(
-            const.AttributeTags.OPERATION,
-            attributes)
-
-        # Set up the default response -- handlers will override these
-        # values if they need to
-        response_kwargs = {}
-        response_kwargs['version']          = request.version
-        response_kwargs['operation_id']     = const.StatusCodes.INTERNAL_ERROR
-        response_kwargs['request_id']       = request.request_id
-        response_kwargs['attribute_groups'] = [attribute_group]
-        response = ipp.Request(**response_kwargs)
-
-        # Get the handler and pass it the request and response objects
-        self.root.handle(request, response)
-        logger.debug("Sending response: %s" % repr(response))
-
-        # Send the response across HTTP
-        self.send_response(200, "Gutenbach IPP Response")
-        self.send_header("Content-Type", "application/ipp")
-        self.send_header("Connection", "close")
-        self.end_headers()
-        self.wfile.write(response.packed_value)
+        pass
Index: server/lib/gutenbach/server/server.py
===================================================================
--- server/lib/gutenbach/server/server.py	(revision 7bd1035512a62917148a585e099d7632eee2a5c8)
+++ server/lib/gutenbach/server/server.py	(revision 7bd1035512a62917148a585e099d7632eee2a5c8)
@@ -0,0 +1,67 @@
+import logging
+import BaseHTTPServer
+import traceback
+from gutenbach.server.requests import GutenbachRequestHandler
+import gutenbach.ipp as ipp
+import gutenbach.ipp.constants as const
+
+# initialize logger
+logger = logging.getLogger(__name__)
+
+class GutenbachIPPServer(BaseHTTPServer.BaseHTTPRequestHandler):
+    def setup(self):
+        self.root = GutenbachRequestHandler()
+        BaseHTTPServer.BaseHTTPRequestHandler.setup(self)
+
+    def handle_one_request(self):
+        self.raw_requestline = self.rfile.readline()
+        if not self.raw_requestline:
+            self.close_connection = 1
+            return
+        if not self.parse_request(): # An error code has been sent, just exit
+            return
+        self.handle_ipp()
+
+    def handle_ipp(self):
+        # Receive a request
+        length = int(self.headers.getheader('content-length', 0))
+        request = ipp.Request(request=self.rfile, length=length)
+        logger.debug("Received request: %s" % repr(request))
+
+        # Operation attributes -- typically the same for any request
+        attributes = [
+            ipp.Attribute(
+                'attributes-charset',
+                [ipp.Value(ipp.Tags.CHARSET, 'utf-8')]),
+            ipp.Attribute(
+                'attributes-natural-language',
+                [ipp.Value(ipp.Tags.NATURAL_LANGUAGE, 'en-us')])
+            ]
+        # Put the operation attributes in a group
+        attribute_group = ipp.AttributeGroup(
+            const.AttributeTags.OPERATION,
+            attributes)
+
+        # Set up the default response -- handlers will override these
+        # values if they need to
+        response_kwargs = {}
+        response_kwargs['version']          = request.version
+        response_kwargs['operation_id']     = const.StatusCodes.OK
+        response_kwargs['request_id']       = request.request_id
+        response_kwargs['attribute_groups'] = [attribute_group]
+        response = ipp.Request(**response_kwargs)
+
+        # Get the handler and pass it the request and response objects
+        try:
+            self.root.handle(request, response)
+        except:
+            response_kwargs['operation_id'] = const.StatusCodes.INTERNAL_ERROR
+            logger.error(traceback.format_exc())
+
+        # Send the response across HTTP
+        logger.debug("Sending response: %s" % repr(response))
+        self.send_response(200, "Gutenbach IPP Response")
+        self.send_header("Content-Type", "application/ipp")
+        self.send_header("Connection", "close")
+        self.end_headers()
+        self.wfile.write(response.packed_value)
