diff --git a/weight.module b/weight.module
index 4743968..baf3158 100644
--- a/weight.module
+++ b/weight.module
@@ -1,6 +1,40 @@
 <?php
 
 /**
+ * Implements hook_entity_property_info().
+ */
+function weight_entity_property_info_alter(&$info) {
+  $info['node']['properties']['weight'] = array(
+    'type' => 'integer',
+    'label' => t('weight'),
+    'description' => t('Provides weight scores on nodes'),
+    'getter callback' => 'weight_get_properties',
+    'setter callback' => 'weight_set_properties',
+  );
+}
+
+/** 
+ * entity API getter.
+ */
+function weight_get_properties($node, array $options, $name, $entity_type) {
+  $weight = _weight_get_weight($node);
+  return $weight;
+}
+
+/** 
+ * entity API setter.
+ */
+function weight_set_properties(&$data, $name, $value, $langcode, $type, $info){
+  $data->weight_weight = $value;
+
+  // skip the execution now and let hook_node_insert handle it
+  if ($data->is_new == TRUE && !isset($data->nid)){
+    return true;
+  }
+  _weight_set_weight($data);
+}
+
+/**
  * Implements hook_permission().
  */
 function weight_permission() {
@@ -567,6 +601,7 @@ function weight_settings_save($settings) {
  * Set the weight of a node.
  */
 function _weight_set_weight($node) {
+
   // Default weight value: passed in weight value
   $weight = $node->weight_weight;
 
