diff --git a/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/comment.inc b/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/comment.inc
index 0d40be6..6b7ff1e 100644
--- a/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/comment.inc
+++ b/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/comment.inc
@@ -18,12 +18,13 @@ function _erpal_basic_service_comment_create($nid, $data) {
     return services_error('comment(s) expected', 400);
   }
 
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
   $comment_ids = array();
   if (!empty($data['comments'])) {
     foreach ($data['comments'] as $value) {
       try {
         $cid = _erpal_basic_service_comment_create_single($nid, $value);
-        $comment_ids[] = url('rest/basic/erpal_comment/' . $nid . '/' . $cid, array('absolute' => TRUE));
+        $comment_ids[] = url("$basic_service_endpoint->path/erpal_comment/$nid/$cid", array('absolute' => TRUE));
       } catch (Exception $e) {
         return services_error($e->getMessage(), 500);
       }
@@ -35,7 +36,7 @@ function _erpal_basic_service_comment_create($nid, $data) {
 
   $result = array();
   $result['success'] = true;
-  $result['url'] = url('rest/basic/erpal_comment/' . $nid, array('absolute' => TRUE));
+  $result['url'] = url("$basic_service_endpoint->path/erpal_comment/$nid", array('absolute' => TRUE));
   $result['cids'] = $comment_ids;
   return $result;
 }
@@ -116,6 +117,7 @@ function _erpal_basic_service_comment_update($nid, $cid, $data) {
     return services_error('failed loading comment with id: ' . $cid, 400);
   }
 
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
   $accepted_node_types = array('erpal_contact', 'erpal_crm_activity', 'erpal_file');
   $node = node_load($comment->nid);
   if (!$node || !is_object($node)) {
@@ -142,7 +144,7 @@ function _erpal_basic_service_comment_update($nid, $cid, $data) {
 
   $result = array();
   $result['success'] = true;
-  $result['url'] = url('rest/basic/erpal_comment/' . $nid . '/' . $cid, array('absolute' => TRUE));
+  $result['url'] = url("$basic_service_endpoint->path/erpal_comment/$nid/$cid", array('absolute' => TRUE));
   return $result;
 }
 
@@ -227,20 +229,25 @@ function _erpal_basic_service_comment_out($id = '', $cid = 0, $start = 0, $count
       return services_error('unsupported node type for nid: ' . $nid . ' (' . $node->type . ')', 400);
     }
 
+    // load endpoints
+    $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
+    $crm_service_endpoint   = services_endpoint_load('erpal_crm_rest');
+    $docs_service_endpoint = services_endpoint_load('erpal_docs_rest');
+
     // base data
     $comments_out['created'] = (int) $node->created;
     $comments_out['changed'] = (int) $node->changed;
-    $comments_out['url'] = url('rest/basic/erpal_comment/' . $node->nid, array('absolute' => TRUE));
+    $comments_out['url'] = url("$basic_service_endpoint->path/erpal_comment/$node->nid", array('absolute' => TRUE));
     $comments_out['subject'] = $node->title;
     $comments_out['parent_type'] = $node->type;
     if ($node->type === 'erpal_contact') {
-      $comments_out['parent_url'] = url('rest/basic/contact/' . $nid, array('absolute' => TRUE));
+      $comments_out['parent_url'] = url("$basic_service_endpoint->path/contact/$nid", array('absolute' => TRUE));
     }
     else if ($node->type === 'erpal_crm_activity') {
-      $comments_out['parent_url'] = url('rest/activity/crm_activity/' . $nid, array('absolute' => TRUE));
+      $comments_out['parent_url'] = url("$crm_service_endpoint->path/crm_activity/$nid", array('absolute' => TRUE));
     }
     else if ($node->type === 'erpal_file') {
-      $comments_out['parent_url'] = url('rest/erpal_files/erpal_file/' . $nid, array('absolute' => TRUE));
+      $comments_out['parent_url'] = url("$docs_service_endpoint->path/erpal_file/$nid", array('absolute' => TRUE));
     }
 
     // revision
@@ -265,20 +272,20 @@ function _erpal_basic_service_comment_out($id = '', $cid = 0, $start = 0, $count
             'created' => (int) $comment->created,
             'changed' => (int) $comment->changed,
             'cid' => (int) $comment->cid,
-            'comment_url' => url('rest/basic/erpal_comment/' . $node->nid . '/' . $comment_id, array('absolute' => TRUE)),
+            'comment_url' => url("$basic_service_endpoint->path/erpal_comment/" . $node->nid . '/' . $comment_id, array('absolute' => TRUE)),
             'subject' => ($comment->subject) ? $comment->subject : '',
             'name' => ($comment->name) ? $comment->name : '',
             'registered_name' => ($comment->registered_name) ? $comment->registered_name : '',
             'comment_body' => $comment_body['value'],
             'comment_format' => $comment_body['format'],
-            'author_url' => url('rest/basic/erpal_user/' . $comment->uid, array('absolute' => TRUE)),
+            'author_url' => url("$basic_service_endpoint->path/erpal_user/" . $comment->uid, array('absolute' => TRUE)),
           );
           // files
           if (!empty($comment->field_asset_files)) {
             $comment_out['attachments'] = array();
             foreach ($comment->field_asset_files[LANGUAGE_NONE] as $key => $value) {
               if (!$include_children || (strtolower($include_children) === 'false')) {
-                $comment_out['attachments'][] = url('rest/erpal_files/erpal_file/' . $value['target_id'], array('absolute' => TRUE));
+                $comment_out['attachments'][] = url("$docs_service_endpoint->path/erpal_file/" . $value['target_id'], array('absolute' => TRUE));
               }
               else {
                 $file = node_load($value['target_id']);
diff --git a/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/contact.inc b/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/contact.inc
index 9a714de..5ed8cc9 100644
--- a/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/contact.inc
+++ b/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/contact.inc
@@ -395,6 +395,7 @@ function _erpal_basic_service_contact_out($nid, $details = TRUE, $include_childr
     return services_error('failed loading node. nid ' . $nid . ' is not a contact', 400);
   }
 
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
   // load wrapper
   $contact_wrapper = entity_metadata_wrapper('node', $contact);
 
@@ -404,7 +405,7 @@ function _erpal_basic_service_contact_out($nid, $details = TRUE, $include_childr
   // base data
   $contact_out['created'] = (int) $contact->created;
   $contact_out['changed'] = (int) $contact->changed;
-  $contact_out['url'] = url('rest/basic/contact/' . $contact->nid, array('absolute' => TRUE));
+  $contact_out['url'] = url("$basic_service_endpoint->path/contact/$contact->nid", array('absolute' => TRUE));
 
   // revision
   $contact_out['revision_timestamp'] = (int) $contact->revision_timestamp;
@@ -532,7 +533,7 @@ function _erpal_basic_service_contact_out($nid, $details = TRUE, $include_childr
       $contact_out['social']['google'] = $contact_wrapper->field_google_plus->url->value();
     }
     // comments
-    $contact_out['comments'] = url('rest/basic/erpal_comment/' . $nid, array('absolute' => TRUE));
+    $contact_out['comments'] = url("$basic_service_endpoint->path/erpal_comment/$nid", array('absolute' => TRUE));
     $query = new EntityFieldQuery();
     $query->entityCondition('entity_type', 'comment')
         ->propertyCondition('nid', $nid);
@@ -552,7 +553,7 @@ function _erpal_basic_service_contact_out($nid, $details = TRUE, $include_childr
             'registered_name'   => ($comment->registered_name) ? $comment->registered_name : '',
             'comment_body'      => $comment_body['value'],
             'comment_format'    => $comment_body['format'],
-            'author_url'        => url('rest/basic/erpal_user/' . $comment->uid, array('absolute' => TRUE)),
+            'author_url'        => url("$basic_service_endpoint->path/erpal_user/$comment->uid", array('absolute' => TRUE)),
           );
           array_push($contact_out['comments'], $comment_out);
         }
@@ -583,12 +584,12 @@ function _erpal_basic_service_create_service_response($errors, $contact_node) {
     services_error($returns['message'], 400);
     return;
   }
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
 
-  return (object)array(
-    'url' => url(
-      services_endpoint_load('erpal_basic_rest')->path . '/contact/' . $contact_node->nid,
-      array('absolute'=>TRUE)
-    )
+  return (object) array(
+        'url' => url(
+            $basic_service_endpoint->path . '/contact/' . $contact_node->nid, array('absolute' => TRUE)
+        )
   );
 }
 
@@ -743,6 +744,7 @@ function _erpal_basic_service_get_works_at_relations($contact, $include_children
 
   $relations_query = new EntityFieldQuery();
   $relations = $relations_query->entityCondition('entity_type', 'relation')->propertyCondition('relation_type', 'works_at')->execute();
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
 
   if (!empty($relations)) {
     foreach (array_keys($relations['relation']) as $rid) {
@@ -756,7 +758,7 @@ function _erpal_basic_service_get_works_at_relations($contact, $include_children
             $works_at[] = _erpal_basic_service_contact_out($contact_1_nid, false, false);
           }
           else {
-            $works_at[] = url('rest/basic/contact/' . $contact_1_nid, array('absolute' => TRUE));
+            $works_at[] = url("$basic_service_endpoint->path/contact/$contact_1_nid", array('absolute' => TRUE));
           }
         }
       }
@@ -799,6 +801,7 @@ function _erpal_basic_service_get_employees_relations($contact, $include_childre
 
   $relations_query = new EntityFieldQuery();
   $relations = $relations_query->entityCondition('entity_type', 'relation')->propertyCondition('relation_type', 'works_at')->execute();
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
 
   if (!empty($relations)) {
     foreach (array_keys($relations['relation']) as $rid) {
@@ -812,7 +815,7 @@ function _erpal_basic_service_get_employees_relations($contact, $include_childre
             $employees[] = _erpal_basic_service_contact_out($contact_0_nid, false, false);
           }
           else {
-            $employees[] = url('rest/basic/contact/' . $contact_0_nid, array('absolute' => TRUE));
+            $employees[] = url("$basic_service_endpoint->path/contact/$contact_0_nid", array('absolute' => TRUE));
           }
         }
       }
diff --git a/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/contact_relation.inc b/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/contact_relation.inc
index e8ae7b6..dfa610c 100644
--- a/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/contact_relation.inc
+++ b/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/contact_relation.inc
@@ -54,8 +54,7 @@ function _erpal_basic_service_contact_relation_index($start = 0, $count = PHP_IN
   $results = $query->execute();
   
   $relations = array();
-  $endpoints = erpal_basic_service_default_services_endpoint();  
-  $endpoint  = array_shift($endpoints);
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
     
   foreach ($results as $rid=>$result) {
     
@@ -64,10 +63,7 @@ function _erpal_basic_service_contact_relation_index($start = 0, $count = PHP_IN
     }else{
       $relations[] = (object)array(
         'revision_id' => $result->vid,
-        'url'         => url(
-          $endpoint->path . '/contact-relation/' . $rid, 
-          array('absolute'=>TRUE)
-        )
+        'url'         => url("$basic_service_endpoint->path/contact-relation/$rid",array('absolute'=>TRUE))
       );
     }
   }
@@ -106,8 +102,7 @@ function _erpal_basic_service_contact_relation_retrieve($rid) {
     return;
   }
   
-  $endpoints  = erpal_basic_service_default_services_endpoint();  
-  $endpoint   = array_shift($endpoints);
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
   $tag        = '';
   
   if (isset($relation->field_work_at_rel_tags[LANGUAGE_NONE])) {
@@ -137,16 +132,13 @@ function _erpal_basic_service_contact_relation_retrieve($rid) {
     'changed'             => (int)$relation->changed,
     'created'             => (int)$relation->created,
     'revision_id'         => (int)$relation->vid,
-    'url'                 => url(
-      $endpoint->path . '/contact-relation/' . $rid, 
-      array('absolute'=>TRUE)
-    ),
+    'url'                 => url("$basic_service_endpoint->path/contact-relation/$rid", array('absolute'=>TRUE)),
     'contact'             => url(
-      $endpoint->path . '/contact/' . $relation_endpoints[0]['entity_id'] , 
+      $basic_service_endpoint->path . '/contact/' . $relation_endpoints[0]['entity_id'],
       array('absolute'=>TRUE)
     ),
     'works_at'            => url(
-      $endpoint->path . '/contact/' . $relation_endpoints[1]['entity_id'] , 
+      $basic_service_endpoint->path . '/contact/' . $relation_endpoints[1]['entity_id'],
       array('absolute'=>TRUE)
     ),
     'tag'                 => $tag,
@@ -272,14 +264,10 @@ function _erpal_basic_service_contact_relation_create($data) {
     return;
   }
  
-  $endpoints  = erpal_basic_service_default_services_endpoint();  
-  $endpoint   = array_shift($endpoints);
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
   
   return array(
-    'url' => url(
-      $endpoint->path . '/contact-relation/' . $relation->rid, 
-      array('absolute'=>TRUE)
-    )
+    'url' => url("$basic_service_endpoint->path/contact-relation/$relation->rid",array('absolute'=>TRUE))
   );
 }
 
@@ -358,14 +346,10 @@ function _erpal_basic_service_contact_relation_update($relation_id, $data) {
     return;
   }
  
-  $endpoints  = erpal_basic_service_default_services_endpoint();  
-  $endpoint   = array_shift($endpoints);
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
   
   return array(
-    'url' => url(
-      $endpoint->path . '/contact-relation/' . $relation_id, 
-      array('absolute'=>TRUE)
-    )
+    'url' => url("$basic_service_endpoint->path/contact-relation/$relation_id", array('absolute'=>TRUE))
   );
 }
 
diff --git a/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/user.inc b/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/user.inc
index 2137436..6bcd6df 100644
--- a/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/user.inc
+++ b/erpal_basic/erpal_basic_helper/modules/erpal_basic_service/inc/user.inc
@@ -60,10 +60,10 @@ function _erpal_basic_service_user_out($uid, $details = true, $include_children
   if (!$user || empty($user)) {
     return services_error('failed retrieving user with id: ' . $uid, 400);
   }
-
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
   $users_out = array();
   $users_out['uid'] = (int) $user->uid;
-  $users_out['url'] = url('rest/basic/erpal_user/' . $user->uid, array('absolute' => TRUE));
+  $users_out['url'] = url("$basic_service_endpoint->path/erpal_user/$user->uid", array('absolute' => TRUE));
   $users_out['name'] = $user->name;
   $users_out['email'] = $user->mail;
   $users_out['created'] = (int) $user->created;
@@ -84,7 +84,7 @@ function _erpal_basic_service_user_out($uid, $details = true, $include_children
     }
   }
 
-  $users_out['permissions'] = url('rest/basic/erpal_permission/' . $user->uid, array('absolute' => TRUE));
+  $users_out['permissions'] = url("$basic_service_endpoint->path/erpal_permission/$user->uid", array('absolute' => TRUE));
 
   return $users_out;
 }
diff --git a/erpal_crm/erpal_crm_helper/modules/erpal_crm_service/inc/activity.inc b/erpal_crm/erpal_crm_helper/modules/erpal_crm_service/inc/activity.inc
index 9e7fe9f..3db2dc7 100644
--- a/erpal_crm/erpal_crm_helper/modules/erpal_crm_service/inc/activity.inc
+++ b/erpal_crm/erpal_crm_helper/modules/erpal_crm_service/inc/activity.inc
@@ -157,18 +157,14 @@ function _erpal_crm_service_crm_activity_update($nid, $data) {
     services_error('failed updating activity: ' . $e->getMessage(), 500, $e->getTraceAsString());
   }
 
-  drupal_load('module', 'erpal_basic_service');
- 
-  $basic_service_endpoint = erpal_crm_service_default_services_endpoint(); 
-  $basic_service_endpoint = array_shift($basic_service_endpoint);
+  // load endpoints entities
+  $crm_service_endpoint = services_endpoint_load('erpal_crm_rest');
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
 
   $result = array();
-  $result['success']          = true;
-  $result['url']              = url('rest/activity/crm_activity/' . $nid, array('absolute' => TRUE));
-  $result['comments']         = url(
-    $basic_service_endpoint->path . '/erpal_comment/' . $nid,
-    array('absolute'=>TRUE)
-  );
+  $result['success'] = true;
+  $result['url'] = url("$crm_service_endpoint->path/crm_activity/$nid", array('absolute' => TRUE));
+  $result['comments'] = url("$basic_service_endpoint->path/erpal_comment/$nid", array('absolute' => TRUE));
   
   return $result;
 }
@@ -234,6 +230,10 @@ function _erpal_crm_service_crm_activity_out($nid, $details = FALSE, $include_ch
     return services_error('failed loading node. nid ' . $nid . ' is not an activity', 400);
   }
 
+  // load endpoints entities
+  $crm_service_endpoint = services_endpoint_load('erpal_crm_rest');
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
+
   // load wrapper
   $activity_wrapper = entity_metadata_wrapper('node', $activity);
 
@@ -241,7 +241,7 @@ function _erpal_crm_service_crm_activity_out($nid, $details = FALSE, $include_ch
   $activity_out = array();
   $activity_out['created'] = (int) $activity->created;
   $activity_out['changed'] = (int) $activity->changed;
-  $activity_out['url'] = url('rest/activity/crm_activity/' . $activity->nid, array('absolute' => TRUE));
+  $activity_out['url'] = url("$crm_service_endpoint->path/crm_activity/$activity->nid", array('absolute' => TRUE));
   $activity_out['title'] = $activity->title;
 
   // revision
@@ -268,7 +268,7 @@ function _erpal_crm_service_crm_activity_out($nid, $details = FALSE, $include_ch
     // customer
     if (!empty($activity->field_customer_ref)) {
       $customer_id = $activity->field_customer_ref[LANGUAGE_NONE][0]['target_id'];
-      $activity_out['customer'] = url('rest/basic/contact/' . $customer_id, array('absolute' => TRUE));
+      $activity_out['customer'] = url("$basic_service_endpoint->path/contact/$customer_id", array('absolute' => TRUE));
     }
 
     // contacts
@@ -276,7 +276,7 @@ function _erpal_crm_service_crm_activity_out($nid, $details = FALSE, $include_ch
     if (!empty($activity->field_contacts_ref)) {
       foreach ($activity->field_contacts_ref[LANGUAGE_NONE] as $key => $value) {
         $contact_id = $value['target_id'];
-        $contact_url = url('rest/basic/contact/' . $contact_id, array('absolute' => TRUE));
+        $contact_url = url("$basic_service_endpoint->path/contact/$contact_id", array('absolute' => TRUE));
         array_push($activity_out['contacts'], $contact_url);
       }
     }
@@ -325,8 +325,7 @@ function _erpal_crm_service_crm_activity_out($nid, $details = FALSE, $include_ch
     // Account manager
     if (!empty($activity->field_account_manager)) {
       $activity_out['account_manager'] = url(
-        'rest/basic/erpal_user/' . $activity_wrapper->field_account_manager->value()->uid, 
-        array('absolute' => TRUE)
+          "$basic_service_endpoint->path/erpal_user/" . $activity_wrapper->field_account_manager->value()->uid, array('absolute' => TRUE)
       );
     }
 
@@ -351,14 +350,14 @@ function _erpal_crm_service_crm_activity_out($nid, $details = FALSE, $include_ch
               'registered_name' => ($comment->registered_name) ? $comment->registered_name : '',
               'comment_body' => $comment_body['value'],
               'comment_format' => $comment_body['format'],
-              'author_url' => url('rest/basic/erpal_user/' . $comment->uid, array('absolute' => TRUE)),
+              'author_url' => url("$basic_service_endpoint->path/erpal_user/$comment->uid", array('absolute' => TRUE)),
             );
             array_push($activity_out['comments'], $comment_out);
           }
         }
       }
       else {
-        $activity_out['comments'] = url('rest/basic/erpal_comment/' . $nid, array('absolute' => TRUE));
+        $activity_out['comments'] = url("$basic_service_endpoint->path/erpal_comment/$nid", array('absolute' => TRUE));
       }
     }
   }
@@ -395,26 +394,13 @@ function _erpal_crm_service_create_service_response($errors, $activity_node) {
     return;
   }
   
-  drupal_load('module', 'erpal_crm_service');
- 
-  $crm_service_endpoint = erpal_crm_service_default_services_endpoint(); 
-  $crm_service_endpoint = array_shift($crm_service_endpoint);
+  $crm_service_endpoint = services_endpoint_load('erpal_crm_rest');
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
   
-  drupal_load('module', 'erpal_basic_service');
- 
-  $basic_service_endpoint = erpal_crm_service_default_services_endpoint(); 
-  $basic_service_endpoint = array_shift($basic_service_endpoint);
- 
-  $returns['error']   = false;
+  $returns['error'] = FALSE;
   $returns['message'] = '';
-  $returns['url']     = url(
-    $crm_service_endpoint->path . '/crm_activity/' . $activity_node->nid,
-    array('absolute'=>TRUE)
-  );
-  $returns['comments'] = url(
-    $basic_service_endpoint->path . '/erpal_comment/' . $activity_node->nid,
-    array('absolute'=>TRUE)
-  );
+  $returns['url'] = url("$crm_service_endpoint->path/crm_activity/$activity_node->nid", array('absolute' => TRUE));
+  $returns['comments'] = url("$basic_service_endpoint->path/erpal_comment/$activity_node->nid", array('absolute' => TRUE));
   
   return (object)$returns;
 }
diff --git a/erpal_docs/modules/erpal_docs_service/inc/files.inc b/erpal_docs/modules/erpal_docs_service/inc/files.inc
index 4b1f355..61955c2 100644
--- a/erpal_docs/modules/erpal_docs_service/inc/files.inc
+++ b/erpal_docs/modules/erpal_docs_service/inc/files.inc
@@ -109,12 +109,16 @@ function _erpal_docs_service_file_out($nid, $details = TRUE, $include_children =
   // load wrapper
   $file_wrapper = entity_metadata_wrapper('node', $file);
 
+  // load endpoints entities
+  $docs_service_endpoint = services_endpoint_load('erpal_docs_rest');
+  $basic_service_endpoint = services_endpoint_load('erpal_basic_rest');
+
   // base data
   $files_out = array();
   $files_out['title'] = $file->title;
   $files_out['created'] = (int) $file->created;
   $files_out['changed'] = (int) $file->changed;
-  $files_out['url'] = url('rest/erpal_files/erpal_file/' . $file->nid, array('absolute' => TRUE));
+  $files_out['url'] = url("$docs_service_endpoint->path/erpal_file/$file->nid", array('absolute' => TRUE));
 
   // revision
   $files_out['revision_timestamp'] = (int) $file->revision_timestamp;
@@ -157,7 +161,7 @@ function _erpal_docs_service_file_out($nid, $details = TRUE, $include_children =
               'comment_format' => $comment_body['format'],
             );
           } else {
-            $comment_out = url('rest/basic/erpal_comment/' . $comment->cid, array('absolute' => TRUE));
+            $comment_out = url("$basic_service_endpoint->path/erpal_comment/$comment->cid", array('absolute' => TRUE));
           }
           array_push($files_out['comments'], $comment_out);
         }
@@ -209,6 +213,7 @@ function _erpal_docs_service_file_create($data) {
     );
     return;
   }
+  $docs_service_endpoint   = services_endpoint_load('erpal_docs_rest');
   drupal_load('module', 'erpal_docs_helper');
   $file_uri       = _erpal_docs_service_upload_path($data->filename); 
   $file           = file_save_data(base64_decode($data->binary), $file_uri, FILE_EXISTS_RENAME);
@@ -259,7 +264,7 @@ function _erpal_docs_service_file_create($data) {
  
   return array(
     'success' => true,
-    'url'     => url('rest/erpal_files/' . $node->nid, array('absolute' => TRUE))
+    'url'     => url("$docs_service_endpoint->path/erpal_file/$node->nid", array('absolute' => TRUE))
   );
 }
  
@@ -301,7 +306,7 @@ function _erpal_docs_service_file_update($nid, $data) {
     );
     return;
   }
-  
+  $docs_service_endpoint   = services_endpoint_load('erpal_docs_rest');
   if (isset ($data->tags) && ! empty($data->tags)) {
 
     $tags = array();
@@ -360,7 +365,7 @@ function _erpal_docs_service_file_update($nid, $data) {
  
   return array(
     'success' => true,
-    'url'     => url('rest/erpal_files/' . $node->nid, array('absolute' => TRUE))
+    'url'     => url("$docs_service_endpoint->path/erpal_file/$node->nid", array('absolute' => TRUE))
   );
 }
 
