--- spaces.install	2009-04-14 15:45:32.000000000 -0400
+++ spaces.install	2010-06-28 21:50:38.000000000 -0400
@@ -29,6 +29,14 @@
  */
 function spaces_enable() {
   db_query("UPDATE {system} SET weight = -1 WHERE name = 'spaces' AND type = 'module'");
+  cache_clear_all('services:methods', 'cache');
+}
+
+/*
+* Implementation of hook_disable()
+*/
+function spaces_disable() {
+  cache_clear_all('services:methods', 'cache');
 }
 
 /**
--- spaces.module	2010-02-09 13:31:34.000000000 -0500
+++ spaces.module	2010-06-28 21:50:38.000000000 -0400
@@ -1456,3 +1456,59 @@
     $vars['body_classes'] .= " spaces-{$space->type}";
   }
 }
+
+/*
+* Implementation of hook_service()
+*/
+function spaces_service() {
+  return array(
+    array(
+      '#method' => 'spaces.getFeatures',
+      '#callback' => 'spaces_service_get_features',
+      '#args' => array(
+        array(
+          '#name' => 'type',
+          '#type' => 'string',
+          '#optional' => false,
+          '#description' => 'The type of space to load (e.g., "user", "og").'
+        ),
+        array(
+          '#name' => 'id',
+          '#type' => 'int',
+          '#optional' => false,
+          '#description' => 'The id of the space to load.'
+        ),
+      ),
+      '#access arguments' => array('access content'),
+      '#return' => 'array',
+      '#help' => 'Returns an array describing the features of the specified space',
+    ),
+    array(
+      '#method' => 'spaces.getSpace',
+      '#callback' => 'spaces_load',
+      '#args' => array(
+        array(
+          '#name' => 'type',
+          '#type' => 'string',
+          '#optional' => false,
+          '#description' => 'The type of space to load (e.g., "user", "og").'
+        ),
+        array(
+          '#name' => 'id',
+          '#type' => 'int',
+          '#optional' => false,
+          '#description' => 'The id of the space to load.'
+        ),
+      ),
+      '#access arguments' => array('access content'),
+      '#return' => 'array',
+      '#help' => 'Returns an array describing the specified space',
+    )
+  );
+}
+
+function spaces_service_get_features($type,$id) {
+  if ($space = spaces_load($type, $id)) {
+    return $space->controllers->variable->get('spaces_features');
+  }
+}
