diff --git a/modules/blogapi.module b/modules/blogapi.module
index 2e5fef9bca01fe8f14eee67b9d372be5513e6cda..8fa29326eb7076addaeb3fce40ad45560588d853 100644
--- a/modules/blogapi.module
+++ b/modules/blogapi.module
@@ -445,13 +445,13 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori
     return blogapi_error($user);
   }
 
-  $nid = $postid;
-  $terms = array();
+  $node = node_load($postid);
+  $node->taxonomy = array();
   foreach ($categories as $category) {
-    $terms[] = $category['categoryId'];
+    $node->taxonomy[] = $category['categoryId'];
   }
-  module_invoke('taxonomy', 'node_save', $nid, $terms);
-  return true;
+  node_save($node);
+  return TRUE;
 }
 
 /**
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index 2e5fef9bca01fe8f14eee67b9d372be5513e6cda..8fa29326eb7076addaeb3fce40ad45560588d853 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -445,13 +445,13 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori
     return blogapi_error($user);
   }
 
-  $nid = $postid;
-  $terms = array();
+  $node = node_load($postid);
+  $node->taxonomy = array();
   foreach ($categories as $category) {
-    $terms[] = $category['categoryId'];
+    $node->taxonomy[] = $category['categoryId'];
   }
-  module_invoke('taxonomy', 'node_save', $nid, $terms);
-  return true;
+  node_save($node);
+  return TRUE;
 }
 
 /**