diff --git a/restws.formats.inc b/restws.formats.inc
index 3a9a958..a6f588f 100644
--- a/restws.formats.inc
+++ b/restws.formats.inc
@@ -381,26 +381,24 @@ abstract class RestWSBaseFormat implements RestWSFormatInterface {
 
     $uris = array();
     $options = array(
-      'absolute' => TRUE,
-      'alias' => TRUE,
       'query' => &$parameters,
     );
 
-    $uris['self'] = url($resourceController->resource(), $options);
+    $uris['self'] = restws_resource_uri($resourceController->resource(), null, $options);
     $parameters['page'] = 0;
-    $uris['first'] = url($resourceController->resource(), $options);
+    $uris['first'] = restws_resource_uri($resourceController->resource(), null, $options);
     $parameters['page'] = $last;
-    $uris['last'] = url($resourceController->resource(), $options);
+    $uris['last'] = restws_resource_uri($resourceController->resource(), null, $options);
 
 
     if ($page != 0) {
       $parameters['page'] = $page - 1;
-      $uris['prev'] = url($resourceController->resource(), $options);
+      $uris['prev'] = restws_resource_uri($resourceController->resource(), null, $options);
     }
 
     if ($page != $last) {
       $parameters['page'] = $page + 1;
-      $uris['next'] = url($resourceController->resource(), $options);
+      $uris['next'] = restws_resource_uri($resourceController->resource(), null, $options);
     }
 
     return $uris;
diff --git a/restws.module b/restws.module
index adf16a6..4e636cf 100644
--- a/restws.module
+++ b/restws.module
@@ -7,14 +7,22 @@
 
 /**
  * Returns info about all defined resources.
+ *
+ * @param string $resource
+ *   By default null, else the info for the given resource will be returned.
  */
-function restws_get_resource_info() {
+function restws_get_resource_info($resource = NULL) {
   $info = &drupal_static(__FUNCTION__);
   if (!isset($info)) {
     $info = module_invoke_all('restws_resource_info');
     drupal_alter('restws_resource_info', $info);
   }
-  return $info;
+  if (!empty($resource)) {
+    return $info[$resource];
+  }
+  else {
+    return $info;
+  }
 }
 
 /**
@@ -351,10 +359,24 @@ function restws_page_callback($resource, $page_callback = NULL) {
 
 /**
  * Returns the URI used for the given resource.
+ *
+ * @param string $resource
+ *   The resource for which uri should be returned.
+ * @param int $id
+ *   An $id for an entity or null if only the base path should be returned.
+ * @param array|null $options
+ *   An optional array with additional options for @see url().
  */
-function restws_resource_uri($resource, $id) {
+function restws_resource_uri($resource, $id = null, $options = null) {
+  $info = restws_get_resource_info($resource);
+  $basepath = isset($info['menu_path']) ? $info['menu_path'] : $resource;
+  $sub_path = isset($id) ? "/$id" : '';
+
   // Avoid having the URLs aliased.
-  return url($resource . '/' . $id, array('absolute' => TRUE, 'alias' => TRUE));
+  $base_options = array('absolute' => TRUE, 'alias' => TRUE);
+  $options = isset($options) ? array_merge($options, $base_options) : $base_options;
+
+  return url($basepath . $sub_path, $options);
 }
 
 /**
