diff --git a/bean.install b/bean.install
index 63fdd7f..e763cfe 100644
--- a/bean.install
+++ b/bean.install
@@ -50,5 +50,82 @@ function bean_schema() {
     'primary key' => array('bid'),
   );
 
+  $schema['bean_type'] = array(
+    'description' => 'Stores information about all defined bean types.',
+    'fields' => array(
+      // Although the "name" should be enough as the primary key, the numeric ID
+      // is required for the internal use of entity API.
+      'id' => array(
+        'type' => 'serial',
+        'not null' => TRUE,
+        'description' => 'Primary Key: Numeric bean type ID.',
+      ),
+      'type' => array(
+        'description' => 'The machine-readable name of this bean type.',
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+      ),
+      'label' => array(
+        'description' => 'The human-readable name of this bean type.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'status' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        // Set the default to ENTITY_CUSTOM without using the constant as it is
+        // not safe to use it at this point.
+        'default' => 0x01,
+        'size' => 'tiny',
+        'description' => 'The exportable status of the entity.',
+      ),
+      'module' => array(
+        'description' => 'The name of the providing module if the entity has been defined in code.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => FALSE,
+      ),
+    ),
+    'primary key' => array('id'),
+    'unique keys' => array(
+      'type' => array('type'),
+    ),
+  );
+  
   return $schema;
-}
\ No newline at end of file
+}
+
+/**
+ * Add in the exportable entity db columns as required by the entity API.
+ */
+function bean_update_7000() {
+  // Add the new primary key field
+  db_drop_primary_key('type');
+  $spec = array(
+    'type' => 'serial',
+    'not null' => TRUE,
+    'description' => 'Primary Key: Numeric bean type ID.',
+  );
+  $new_keys = array(
+  'primary key' => array('id'),
+  'unique keys' => array(
+    'type' => array('type'),
+  ));
+  db_add_field('bean_type', 'id', $spec, $new_keys);
+
+  // Add the exportable columns
+  if (!function_exists('entity_exportable_schema_fields')) {
+    throw new DrupalUpdateException(t('Please update the Entity API module first.'));
+  }
+  foreach (entity_exportable_schema_fields() as $field => $spec) {
+    db_add_field('bean_type', $field, $spec);
+  }
+
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
+}
diff --git a/bean.module b/bean.module
index 7c68cd4..4899827 100644
--- a/bean.module
+++ b/bean.module
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implements hook_entity_info()
+ * Implement hook_entity_info().
  */
 function bean_entity_info() {
   $return = array(
@@ -20,41 +20,63 @@ function bean_entity_info() {
         'id' => 'bid',
         'bundle' => 'type',
       ),
+      // Make use the class' label() and uri() implementation by default.
+      'label callback' => 'entity_class_label',
+      'uri callback' => 'entity_class_uri',
+      'access callback' => 'bean_access',
       'bundles' => array(),
       'bundle keys' => array(
         'bundle' => 'type',
       ),
-      'label callback' => 'entity_class_label',
-      'uri callback' => 'entity_class_uri',
-      'access callback' => 'bean_access',
       'module' => 'bean',
       'metadata controller class' => 'BeanMetadataController'
     ),
+    'bean_type' => array(
+      'label' => t('Block type'),
+      'entity class' => 'Entity',
+      'controller class' => 'EntityAPIController',
+      'base table' => 'bean_type',
+      'fieldable' => FALSE,
+      'bundle of' => 'bean',
+      'exportable' => TRUE,
+      'entity keys' => array(
+        'id' => 'id',
+        'name' => 'type',
+      ),
+    ),
   );
 
-  foreach (bean_get_types() as $type) {
-    $return['bean']['bundles'][$type->type] = array(
-      'label' => $type->getLabel(),
+  return $return;
+}
+
+
+/**
+ * Implement hook_entity_info_alter().
+ *
+ * Use this hook to specify entity test bundles to avoid a recursion, as loading
+ * the entity test types needs the entity info too.
+ */
+function bean_entity_info_alter(&$entity_info) {
+  foreach (bean_get_types() as $name => $info) {
+    $entity_info['bean']['bundles'][$name] = array(
+      'label' => $info->getLabel(),
       'admin' => array(
         'path' => 'admin/structure/block/types/manage/%bean_type',
-        'real path' => 'admin/structure/block/types/manage/' . $type->buildURL(),
+        'real path' => 'admin/structure/block/types/manage/' . $info->buildURL(),
         'bundle argument' => 5,
         'access arguments' => array('administer bean types'),
       )
     );
   }
-
-  return $return;
 }
 
+
 /**
  * Implements hook_menu().
  */
 function bean_menu() {
   $items = array();
 
-
-
   $items['block/add'] = array(
     'title' => 'Add Block',
     'page callback' => 'bean_add_page',
@@ -462,6 +484,7 @@ function bean_delete($bean) {
   return entity_delete('bean', $bean);
 }
 
+
 /**
  * Helper to easily create a bean.
  *
diff --git a/bean_admin_ui/bean_admin_ui.install b/bean_admin_ui/bean_admin_ui.install
index 0d9831a..6703274 100644
--- a/bean_admin_ui/bean_admin_ui.install
+++ b/bean_admin_ui/bean_admin_ui.install
@@ -5,29 +5,3 @@
  * Install files
  */
 
-/**
- * Implementation of hook_schema
- */
-function bean_admin_ui_schema() {
-  $schema['bean_type'] = array(
-    'description' => 'Stores information about all defined bean types.',
-    'fields' => array(
-      'type' => array(
-        'description' => 'The machine-readable name of this bean type.',
-        'type' => 'varchar',
-        'length' => 32,
-        'not null' => TRUE,
-      ),
-      'label' => array(
-        'description' => 'The human-readable name of this bean type.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-    ),
-    'primary key' => array('type'),
-  );
-
-  return $schema;
-}
\ No newline at end of file
diff --git a/includes/bean.core.inc b/includes/bean.core.inc
index 12c6fdb..c08c0ca 100644
--- a/includes/bean.core.inc
+++ b/includes/bean.core.inc
@@ -21,7 +21,7 @@ class Bean extends Entity {
     return $this->label;
   }
 
-  public function __construct($values = array()) {
+  public function __construct(array $values = array(), $entityType = NULL) {
     parent::__construct($values, 'bean');
 
     // Load the plugin info
