Preparation to bower release
diff --git a/src/services/csrfToken.interceptor.js b/src/services/csrfToken.interceptor.js
new file mode 100644
index 0000000..5f87de5
--- /dev/null
+++ b/src/services/csrfToken.interceptor.js
@@ -0,0 +1,24 @@
+(function() {
+  'use strict';
+
+  /**
+  * @ngdoc service
+  * @name xos.helpers.SetCSRFToken
+  * @description This factory is automatically loaded trough xos.helpers and will add an $http interceptor that will the CSRF-Token to your request headers
+  **/
+
+  angular
+      .module('xos.helpers')
+      .factory('SetCSRFToken', setCSRFToken);
+
+  function setCSRFToken($cookies) {
+    return {
+      request: function(request){
+        if(request.method !== 'GET'){
+          request.headers['X-CSRFToken'] = $cookies.get('xoscsrftoken');
+        }
+        return request;
+      }
+    };
+  }
+})();
diff --git a/src/services/helpers/ui/comparator.service.js b/src/services/helpers/ui/comparator.service.js
new file mode 100644
index 0000000..24bf9f9
--- /dev/null
+++ b/src/services/helpers/ui/comparator.service.js
@@ -0,0 +1,96 @@
+(function() {
+  'use strict';
+
+  /**
+   * @ngdoc service
+   * @name xos.uiComponents.Comparator
+   * @description
+   * This factory define a function that replace the native angular.filter comparator.
+   *
+   * It is done to allow the comparation between (0|1) values with booleans.
+   * >Note that this factory return a single function, not an object.
+   *
+   * The tipical usage of this factory is inside an `ng-repeat`
+   * @example
+   * <example module="comparator">
+   *   <file name="index.html">
+   *     <div ng-controller="sample as vm">
+   *       <div class="row">
+   *         <div class="col-xs-6">
+   *           <label>Filter by name:</label>
+   *           <input class="form-control" type="text" ng-model="vm.query.name"/>
+   *         </div>
+   *         <div class="col-xs-6">
+   *           <label>Filter by status:</label>
+   *           <select
+   *            ng-model="vm.query.status"
+   *            ng-options="i for i in [true, false]">
+   *           </select>
+   *         </div>
+   *       </div>
+   *       <div ng-repeat="item in vm.data | filter:vm.query:vm.comparator">
+   *         <div class="row">
+   *           <div class="col-xs-6">{{item.name}}</div>
+   *           <div class="col-xs-6">{{item.status}}</div>
+   *         </div>
+   *       </div>
+   *     </div>
+   *   </file>
+   *   <file name="script.js">
+   *     angular.module('comparator', ['xos.uiComponents'])
+   *     .controller('sample', function(Comparator){
+   *       this.comparator = Comparator;
+   *       this.data = [
+   *         {name: 'Jhon', status: 1},
+   *         {name: 'Jack', status: 0},
+   *         {name: 'Mike', status: 1},
+   *         {name: 'Scott', status: 0}
+   *       ];
+   *     });
+   *   </file>
+   * </example>
+   **/
+
+  angular
+    .module('xos.uiComponents')
+    .factory('Comparator', comparator);
+
+  function comparator(_) {
+
+    return function(actual, expected){
+
+      if (angular.isUndefined(actual)) {
+        // No substring matching against `undefined`
+        return false;
+      }
+      if ((actual === null) || (expected === null)) {
+        // No substring matching against `null`; only match against `null`
+        return actual === expected;
+      }
+      if (angular.isObject(expected) || (angular.isObject(actual))){
+        return angular.equals(expected, actual);
+      }
+
+      if(_.isBoolean(actual) || _.isBoolean(expected)){
+        if(actual === 0 || actual === 1){
+          actual = !!actual;
+        }
+        return angular.equals(expected, actual);
+      }
+
+      if(!angular.isString(actual) || !angular.isString(expected)){
+        if(angular.isDefined(actual.toString) && angular.isDefined(expected.toString)){
+          actual = actual.toString();
+          expected = expected.toString();
+        }
+        else {
+          return actual === expected;
+        }
+      }
+
+      actual = actual.toLowerCase() + '';
+      expected = expected.toLowerCase() + '';
+      return actual.indexOf(expected) !== -1;
+    };
+  }
+})();
diff --git a/src/services/helpers/ui/form.helpers.js b/src/services/helpers/ui/form.helpers.js
new file mode 100644
index 0000000..582cb8a
--- /dev/null
+++ b/src/services/helpers/ui/form.helpers.js
@@ -0,0 +1,152 @@
+(function () {
+  
+  angular.module('xos.uiComponents')
+
+  /**
+  * @ngdoc service
+  * @name xos.uiComponents.XosFormHelpers
+  * @requires xos.uiComponents.LabelFormatter
+  * @requires xos.helpers._
+  **/
+
+  .service('XosFormHelpers', function(_, LabelFormatter){
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.XosFormHelpers#_isEmail
+    * @methodOf xos.uiComponents.XosFormHelpers
+    * @description
+    * Return true if the string is an email address
+    * @param {string} text The string to be evaluated
+    * @returns {boolean} If the string match an email format
+    **/
+
+    this._isEmail = (text) => {
+      const re = /(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
+      return re.test(text);
+    };
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.XosFormHelpers#_getFieldFormat
+    * @methodOf xos.uiComponents.XosFormHelpers
+    * @description
+    * Return the type of the input
+    * @param {mixed} value The data to be evaluated
+    * @returns {string} The type of the input
+    **/
+
+    this._getFieldFormat = (value) => {
+
+      if(angular.isArray(value)){
+        return 'array';
+      }
+
+      // check if is date
+      if (_.isDate(value) || (!Number.isNaN(Date.parse(value)) && new Date(value).getTime() > 631180800000)){
+        return 'date';
+      }
+
+      // check if is boolean
+      // isNaN(false) = false, false is a number (0), true is a number (1)
+      if(typeof value  === 'boolean'){
+        return 'boolean';
+      }
+
+      // check if a string is an email
+      if(this._isEmail(value)){
+        return 'email';
+      }
+
+      // if null return string
+      if(angular.isString(value) || value === null){
+        return 'text';
+      }
+
+      return typeof value;
+    };
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.XosFormHelpers#buildFormStructure
+    * @methodOf xos.uiComponents.XosFormHelpers
+    * @description
+    * Return the type of the input
+    * @param {object} modelField An object containing one property for each field of the model
+    * @param {object} customField An object containing one property for each field custom field
+    * @param {object} model The actual model on wich build the form structure (it is used to determine the type of the input)
+    * @returns {object} An object describing the form structure in the form of:
+    * ```
+    * {
+    *   'field-name': {
+    *     label: 'Label',
+    *     type: 'number', //typeof field
+    *     validators: {}, // see xosForm for more details
+    *     hint: 'A Custom hint for the field'
+    *   }
+    * }
+    * ```
+    **/
+
+    this.buildFormStructure = (modelField, customField, model) => {
+
+      modelField = angular.extend(modelField, customField);
+      customField = customField || {};
+
+      return _.reduce(Object.keys(modelField), (form, f) => {
+
+        form[f] = {
+          label: (customField[f] && customField[f].label) ? `${customField[f].label}:` : LabelFormatter.format(f),
+          type: (customField[f] && customField[f].type) ? customField[f].type : this._getFieldFormat(model[f]),
+          validators: (customField[f] && customField[f].validators) ? customField[f].validators : {},
+          hint: (customField[f] && customField[f].hint)? customField[f].hint : '',
+        };
+
+        if(customField[f] && customField[f].options){
+          form[f].options = customField[f].options;
+        }
+        if(customField[f] && customField[f].properties){
+          form[f].properties = customField[f].properties;
+        }
+        if(form[f].type === 'date'){
+          model[f] = new Date(model[f]);
+        }
+
+        if(form[f].type === 'number'){
+          model[f] = parseInt(model[f], 10);
+        }
+
+        return form;
+      }, {});
+    };
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.XosFormHelpers#parseModelField
+    * @methodOf xos.uiComponents.XosFormHelpers
+    * @description
+    * Helpers for buildFormStructure, convert a list of model properties in an object used to build the form structure, eg:
+    * ```
+    * // input:
+    * ['id', 'name'm 'mail']
+    *
+    * // output
+    * {
+    *   id: {},
+    *   name: {},
+    *   mail: {}
+    * }
+    * ```
+    * @param {array} fields An array of fields representing the model properties
+    * @returns {object} An object containing one property for each field of the model
+    **/
+
+    this.parseModelField = (fields) => {
+      return _.reduce(fields, (form, f) => {
+        form[f] = {};
+        return form;
+      }, {});
+    }
+
+  });
+})();
\ No newline at end of file
diff --git a/src/services/helpers/ui/label_formatter.service.js b/src/services/helpers/ui/label_formatter.service.js
new file mode 100644
index 0000000..f23fea4
--- /dev/null
+++ b/src/services/helpers/ui/label_formatter.service.js
@@ -0,0 +1,90 @@
+(function() {
+  'use strict';
+
+  /**
+  * @ngdoc service
+  * @name xos.uiComponents.LabelFormatter
+  * @description This factory define a set of helper function to format label started from an object property
+  **/
+
+  angular
+      .module('xos.uiComponents')
+      .factory('LabelFormatter', labelFormatter);
+
+  function labelFormatter() {
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.LabelFormatter#_formatByUnderscore
+    * @methodOf xos.uiComponents.LabelFormatter
+    * @description
+    * Convert a `snake_case` string to readable string.<br/>
+    * Eg: `this_string` will became `this string`
+    * @param {string} string The string to be converted
+    * @returns {string} The converten string
+    **/
+
+    const _formatByUnderscore = string => string.split('_').join(' ').trim();
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.LabelFormatter#_formatByUppercase
+    * @methodOf xos.uiComponents.LabelFormatter
+    * @description
+    * Convert a `camelCase` string to readable string.<br/>
+    * Eg: `thisString` will became `this string`
+    * @param {string} string The string to be converted
+    * @returns {string} The converten string
+    **/
+
+    const _formatByUppercase = string => string.split(/(?=[A-Z])/).map(w => w.toLowerCase()).join(' ');
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.LabelFormatter#_capitalize
+    * @methodOf xos.uiComponents.LabelFormatter
+    * @description
+    * Capitalize the first letter of a string.<br/>
+    * Eg: `this string` will became `This string`
+    * @param {string} string The string to be converted
+    * @returns {string} The converten string
+    **/
+
+    const _capitalize = string => string.slice(0, 1).toUpperCase() + string.slice(1);
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.LabelFormatter#format
+    * @methodOf xos.uiComponents.LabelFormatter
+    * @description
+    * Apply in order:
+    * - _formatByUnderscore
+    * - _formatByUppercase
+    * - _capitalize
+    * - replace multiple space with a single one
+    * - append `:` at the end 
+    * <br/>
+    * Eg: `this_string` will became `This string:`<br/>
+    * Eg: `thisString` will became `This string:`
+    * @param {string} string The string to be converted
+    * @returns {string} The converten string
+    **/
+
+    const format = (string) => {
+      string = _formatByUnderscore(string);
+      string = _formatByUppercase(string);
+
+      string = _capitalize(string).replace(/\s\s+/g, ' ') + ':';
+      return string.replace('::', ':');
+    };
+
+    return {
+      // test export
+      _formatByUnderscore: _formatByUnderscore,
+      _formatByUppercase: _formatByUppercase,
+      _capitalize: _capitalize,
+      // export to use
+      format: format
+    };
+  }
+})();
diff --git a/src/services/helpers/user-prefs.service.js b/src/services/helpers/user-prefs.service.js
new file mode 100644
index 0000000..f3f1f19
--- /dev/null
+++ b/src/services/helpers/user-prefs.service.js
@@ -0,0 +1,154 @@
+(function () {

+  

+  angular.module('xos.helpers')

+

+  /**

+  * @ngdoc service

+  * @name xos.helpers.XosUserPrefs

+  * @description

+  * This service is used to store the user preferences in cookies, so that they survive to page changes.

+  * The structure of the user preference is:

+  * ```

+  * {

+  *   synchronizers: {

+  *     notification: {

+  *       'volt': boolean,

+  *       'openstack': boolean,

+  *       ...

+  *     }

+  *   }

+  *   userData: {

+  *     current_user_site_id: Number,

+  *     current_user_site_user_names: Array[1],

+  *     ...

+  *     }

+  * }

+  * ```

+  **/

+

+  .service('XosUserPrefs', function($cookies, Me, $q){

+

+    let userPrefs = $cookies.get('xosUserPrefs') ? angular.fromJson($cookies.get('xosUserPrefs')) : {};

+

+    /**

+    * @ngdoc method

+    * @name xos.helpers.XosUserPrefs#getAll

+    * @methodOf xos.helpers.XosUserPrefs

+    * @description

+    * Return all the user preferences stored in cookies

+    * @returns {object} The user preferences

+    **/

+    this.getAll = () => {

+      userPrefs = $cookies.get('xosUserPrefs') ? angular.fromJson($cookies.get('xosUserPrefs')) : {};

+      return userPrefs;

+    };

+

+    /**

+    * @ngdoc method

+    * @name xos.helpers.XosUserPrefs#setAll

+    * @methodOf xos.helpers.XosUserPrefs

+    * @description

+    * Override all user preferences

+    * @param {object} prefs The user preferences

+    **/

+    this.setAll = (prefs) => {

+      $cookies.put('xosUserPrefs', angular.toJson(prefs));

+    };

+

+    /**

+    * @ngdoc method

+    * @name xos.helpers.XosUserPrefs#getSynchronizerNotificationStatus

+    * @methodOf xos.helpers.XosUserPrefs

+    * @description

+    * Return the synchronizer notification status, if name is not provided return the status for all synchronizers

+    * @param {string=} prefs The synchronizer name

+    * @returns {object | string} The synchronizer status

+    **/

+    this.getSynchronizerNotificationStatus = (name = false) => {

+      if(name){

+        return this.getAll().synchronizers.notification[name];

+      }

+      return this.getAll().synchronizers.notification;

+    };

+

+

+    /**

+    * @ngdoc method

+    * @name xos.helpers.XosUserPrefs#getUserDetailsCookie

+    * @methodOf xos.helpers.XosUserPrefs

+    * @description

+    * Return all the user details stored in cookies or call the service

+    * @returns {object} The user details

+    **/

+    this.getUserDetailsCookie = () => {

+      const defer = $q.defer();

+      let localPref  = this.getAll();

+      if(!localPref.userData){

+        this.setUserDetailsCookie().$promise.then((data)=>{

+          defer.resolve(data);

+        });

+      }

+      else{

+        defer.resolve(localPref.userData);

+      }

+      return {$promise: defer.promise};

+    };

+

+    /**

+    * @ngdoc method

+    * @name xos.helpers.XosUserPrefs#setUserDetailsCookie

+    * @methodOf xos.helpers.XosUserPrefs

+    * @description

+    * Save the user details in the cookie

+    * @param {object} details stored in cookie

+    * @param {objects} returns the user details as a promise

+    **/

+    this.setUserDetailsCookie = (userData = null)=> {

+

+      const defer = $q.defer();

+      let cookies = this.getAll();

+      if (!userData){

+        Me.get().then((user)=> {

+          cookies.userData = user;

+          this.setAll(cookies);

+          defer.resolve(user);

+        })

+        .catch ((e) => {

+          defer.reject(e);

+        });

+      }

+      else {

+        cookies.userData = userData;

+        this.setAll(cookies);

+        defer.resolve(userData);

+      }

+      return {$promise: defer.promise};

+    }

+

+     /**

+    * @ngdoc method

+    * @name xos.helpers.XosUserPrefs#setSynchronizerNotificationStatus

+    * @methodOf xos.helpers.XosUserPrefs

+    * @description

+    * Update the notification status for a single synchronizer

+    * @param {string} name The synchronizer name

+    * @param {boolean} value The notification status (true means that it has been sent)

+    **/

+

+    this.setSynchronizerNotificationStatus = (name = false, value) => {

+      if(!name){

+        throw new Error('[XosUserPrefs] When updating a synchronizer is mandatory to provide a name.')

+      }

+

+      let cookies = this.getAll();

+

+      if(!cookies.synchronizers){

+        cookies.synchronizers = {

+          notification: {}

+        }

+      }

+      cookies.synchronizers.notification[name] = value;

+      this.setAll(cookies);

+    }

+  });

+})();
\ No newline at end of file
diff --git a/src/services/log.decorator.js b/src/services/log.decorator.js
new file mode 100644
index 0000000..37d36f9
--- /dev/null
+++ b/src/services/log.decorator.js
@@ -0,0 +1,60 @@
+// TODO write tests for log
+
+/* eslint-disable  angular/ng_window_service*/
+
+angular.module('xos.helpers')
+.config([ '$provide', function( $provide )
+{
+  // Use the `decorator` solution to substitute or attach behaviors to
+  // original service instance; @see angular-mocks for more examples....
+
+  $provide.decorator( '$log', [ '$delegate', function( $delegate )
+  {
+
+    const isLogEnabled = () => {
+      return window.location.href.indexOf('debug=true') >= 0;
+    };
+    // Save the original $log.debug()
+    let logFn = $delegate.log;
+    let infoFn = $delegate.info;
+    let warnFn = $delegate.warn;
+    //let errorFn = $delegate.error;
+    let debugFn = $delegate.debug;
+
+    // create the replacement function
+    const replacement = (fn) => {
+      return function(){
+         //console.log(`Is Log Enabled: ${isLogEnabled()}`)
+        if(!isLogEnabled()){
+          // console.log('logging is disabled');
+          return;
+        }
+
+        let args    = [].slice.call(arguments);
+        let now     = new Date();
+
+        // Prepend timestamp
+        args[0] = `[${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}] ${args[0]}`;
+
+        // HACK awfull fix for angular mock implementation whithin jasmine test failing issue
+        if (angular.isFunction($delegate.reset) && !($delegate.debug.logs instanceof Array)) {
+          // if we are within the mock and did not reset yet, we call it to avoid issue
+          // console.log('mock log impl fix to avoid logs array not existing...');
+          $delegate.reset();
+        }
+
+        // Call the original with the output prepended with formatted timestamp
+
+        return fn.apply(null, args)
+      };
+    };
+
+    $delegate.info = replacement(infoFn);
+    $delegate.log = replacement(logFn);
+    $delegate.warn = replacement(warnFn);
+    //$delegate.error = replacement(errorFn); // note this will prevent errors to be printed
+    $delegate.debug = replacement(debugFn);
+
+    return $delegate;
+  }]);
+}]);
\ No newline at end of file
diff --git a/src/services/noHyperlinks.interceptor.js b/src/services/noHyperlinks.interceptor.js
new file mode 100644
index 0000000..af3dd63
--- /dev/null
+++ b/src/services/noHyperlinks.interceptor.js
@@ -0,0 +1,24 @@
+(function() {
+  'use strict';
+
+  /**
+  * @ngdoc service
+  * @name xos.helpers.NoHyperlinks
+  * @description This factory is automatically loaded trough xos.helpers and will add an $http interceptor that will add ?no_hyperlinks=1 to your api request, that is required by django
+  **/
+
+  angular
+      .module('xos.helpers')
+      .factory('NoHyperlinks', noHyperlinks);
+
+  function noHyperlinks() {
+    return {
+      request: function(request){
+        if(request.url.indexOf('.html') === -1){
+          request.url += '?no_hyperlinks=1';
+        }
+        return request;
+      }
+    };
+  }
+})();
\ No newline at end of file
diff --git a/src/services/notification.service.js b/src/services/notification.service.js
new file mode 100644
index 0000000..9a1598e
--- /dev/null
+++ b/src/services/notification.service.js
@@ -0,0 +1,62 @@
+/* eslint-disable  angular/ng_window_service*/
+(function() {
+  'use strict';
+
+  angular
+  .module('xos.helpers')
+  .factory('Notification', function(){
+    return window.Notification;
+  })
+  /**
+  * @ngdoc service
+  * @name xos.helpers.xosNotification
+  * @description This factory define a set of helper function to trigger desktop notification
+  **/
+  .service('xosNotification', function($q, $log, Notification) {
+
+    this.checkPermission = () => {
+      const deferred = $q.defer();
+      Notification.requestPermission()
+      .then(permission => {
+        if (permission === 'granted') {
+          deferred.resolve(permission);
+        }
+        else {
+          deferred.reject(permission);
+        }
+      });
+      return deferred.promise;
+    };
+
+    this.sendNotification = (title, options) => {
+      const notification = new Notification(title, options);
+      notification.onerror = function(err){
+        $log.error(err);
+      };
+    };
+
+    /**
+    * @ngdoc method
+    * @name xos.helpers.xosNotification#notify
+    * @methodOf xos.helpers.xosNotification
+    * @description
+    * This method will check for user permission and if granted will send a browser notification.
+    * @param {string} title The notification title
+    * @param {object} options The notification options: `{icon: 'url', body: 'Notification body'}`
+    **/
+
+    this.notify = (title, options) => {
+      if (!('Notification' in window)) {
+        $log.info('This browser does not support desktop notification');
+      }
+      else if (Notification.permission !== 'granted') {
+        this.checkPermission()
+        .then(() => this.sendNotification(title, options));
+      }
+      else if (Notification.permission === 'granted') {
+        this.sendNotification(title, options);
+      }
+    }
+
+  })
+})();
diff --git a/src/services/rest/Dashboards.js b/src/services/rest/Dashboards.js
new file mode 100644
index 0000000..42af90b
--- /dev/null
+++ b/src/services/rest/Dashboards.js
@@ -0,0 +1,31 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Dashboards
+  * @description Angular resource to fetch /api/core/dashboardviews/:id/
+  **/
+  .service('Dashboards', function($resource, $q, $http){
+    const r = $resource('/api/core/dashboardviews/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+
+    r.prototype.$save = function(){
+      const d = $q.defer();
+
+      $http.put(`/api/core/dashboardviews/${this.id}/`, this)
+      .then((res) => {
+        d.resolve(res.data);
+      })
+      .catch(e => {
+        d.reject(e.data);
+      });
+
+      return d.promise;
+    }
+
+    return r;
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Deployments.js b/src/services/rest/Deployments.js
new file mode 100644
index 0000000..4fecbc2
--- /dev/null
+++ b/src/services/rest/Deployments.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Deployments
+  * @description Angular resource to fetch /api/core/deployments/:id/
+  **/
+  .service('Deployments', function($resource){
+    return $resource('/api/core/deployments/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Example.js b/src/services/rest/Example.js
new file mode 100644
index 0000000..b13ccda
--- /dev/null
+++ b/src/services/rest/Example.js
@@ -0,0 +1,13 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Example-Services-Collection
+  * @description Angular resource to fetch /api/service/exampleservice/
+  **/
+  .service('Example-Services-Collection', function($resource){
+    return $resource('/api/service/exampleservice/');
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Flavors.js b/src/services/rest/Flavors.js
new file mode 100644
index 0000000..348b770
--- /dev/null
+++ b/src/services/rest/Flavors.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Flavors
+  * @description Angular resource to fetch /api/core/flavors/:id/
+  **/
+  .service('Flavors', function($resource){
+    return $resource('/api/core/flavors/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Images.js b/src/services/rest/Images.js
new file mode 100644
index 0000000..4fe9cb3
--- /dev/null
+++ b/src/services/rest/Images.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Images
+  * @description Angular resource to fetch /api/core/images/
+  **/
+  .service('Images', function($resource){
+    return $resource('/api/core/images/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Instances.js b/src/services/rest/Instances.js
new file mode 100644
index 0000000..f1e8521
--- /dev/null
+++ b/src/services/rest/Instances.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Instances
+  * @description Angular resource to fetch /api/core/instances/:id/
+  **/
+  .service('Instances', function($resource){
+    return $resource('/api/core/instances/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Me.js b/src/services/rest/Me.js
new file mode 100644
index 0000000..5dd1043
--- /dev/null
+++ b/src/services/rest/Me.js
@@ -0,0 +1,26 @@
+(function() {

+  'use strict';

+

+  angular.module('xos.helpers')

+  /**

+  * @ngdoc service

+  * @name xos.helpers.Me

+  * @description Http read-only api to fetch /api/utility/me/

+  **/

+  .service('Me', function($q,$http){

+

+    this.get = () => {

+      let deferred = $q.defer();

+

+      $http.get('/api/utility/me/')

+      .then(res => {

+        deferred.resolve(res.data);

+      })

+      .catch(e => {

+        deferred.reject(e);

+      });

+      return deferred.promise;

+

+    };

+  })

+})();
\ No newline at end of file
diff --git a/src/services/rest/Networks.js b/src/services/rest/Networks.js
new file mode 100644
index 0000000..74b73b6
--- /dev/null
+++ b/src/services/rest/Networks.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Networks
+  * @description Angular resource to fetch /api/core/networks/:id/
+  **/
+  .service('Networks', function($resource){
+    return $resource('/api/core/networks/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
diff --git a/src/services/rest/Networkstemplates.js b/src/services/rest/Networkstemplates.js
new file mode 100644
index 0000000..961d5d8
--- /dev/null
+++ b/src/services/rest/Networkstemplates.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Networkstemplates
+  * @description Angular resource to fetch /api/core/networktemplates/:id/
+  **/
+  .service('Networkstemplates', function($resource){
+    return $resource('/api/core/networktemplates/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
diff --git a/src/services/rest/Nodes.js b/src/services/rest/Nodes.js
new file mode 100644
index 0000000..bf2e387
--- /dev/null
+++ b/src/services/rest/Nodes.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Nodes
+  * @description Angular resource to fetch /api/core/nodes/:id/
+  **/
+  .service('Nodes', function($resource){
+    return $resource('/api/core/nodes/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/ONOS-Apps.js b/src/services/rest/ONOS-Apps.js
new file mode 100644
index 0000000..8d4c104
--- /dev/null
+++ b/src/services/rest/ONOS-Apps.js
@@ -0,0 +1,13 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.ONOS-App-Collection
+  * @description Angular resource to fetch /api/tenant/onos/app/
+  **/
+  .service('ONOS-App-Collection', function($resource){
+    return $resource('/api/tenant/onos/app/');
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/ONOS-Services.js b/src/services/rest/ONOS-Services.js
new file mode 100644
index 0000000..19270e1
--- /dev/null
+++ b/src/services/rest/ONOS-Services.js
@@ -0,0 +1,13 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.ONOS-Services-Collection
+  * @description Angular resource to fetch /api/service/onos/
+  **/
+  .service('ONOS-Services-Collection', function($resource){
+    return $resource('/api/service/onos/');
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Services.js b/src/services/rest/Services.js
new file mode 100644
index 0000000..eda57e4
--- /dev/null
+++ b/src/services/rest/Services.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Services
+  * @description Angular resource to fetch /api/core/services/:id/
+  **/
+  .service('Services', function($resource){
+    return $resource('/api/core/services/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Sites.js b/src/services/rest/Sites.js
new file mode 100644
index 0000000..818d741
--- /dev/null
+++ b/src/services/rest/Sites.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Sites
+  * @description Angular resource to fetch /api/core/sites/:id/
+  **/
+  .service('Sites', function($resource){
+    return $resource('/api/core/sites/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Slices.js b/src/services/rest/Slices.js
new file mode 100644
index 0000000..5a0da11
--- /dev/null
+++ b/src/services/rest/Slices.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Slices
+  * @description Angular resource to fetch /api/core/slices/:id/
+  **/
+  .service('Slices', function($resource){
+    return $resource('/api/core/slices/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Slices_plus.js b/src/services/rest/Slices_plus.js
new file mode 100644
index 0000000..8213b11
--- /dev/null
+++ b/src/services/rest/Slices_plus.js
@@ -0,0 +1,40 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.SlicesPlus
+  * @description Angular resource to fetch /api/utility/slicesplus/
+  * This is a read-only API and only the `query` method is currently supported.
+  **/
+  .service('SlicesPlus', function($http, $q){
+    this.query = (params) => {
+      let deferred = $q.defer();
+
+      $http.get('/api/utility/slicesplus/', {params: params})
+      .then(res => {
+        deferred.resolve(res.data);
+      })
+      .catch(res => {
+        deferred.reject(res.data);
+      });
+
+      return {$promise: deferred.promise};
+    }
+
+    this.get = (id, params) => {
+      let deferred = $q.defer();
+
+      $http.get(`/api/utility/slicesplus/${id}`, {params: params})
+      .then(res => {
+        deferred.resolve(res.data);
+      })
+      .catch(res => {
+        deferred.reject(res.data);
+      });
+      return {$promise: deferred.promise};
+      
+    }
+  })
+})();
diff --git a/src/services/rest/Subscribers.js b/src/services/rest/Subscribers.js
new file mode 100644
index 0000000..945e1e8
--- /dev/null
+++ b/src/services/rest/Subscribers.js
@@ -0,0 +1,147 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Subscribers
+  * @description Angular resource to fetch Subscribers
+  **/
+  .service('Subscribers', function($resource){
+    return $resource('/api/tenant/cord/subscriber/:id/', { id: '@id' }, {
+      update: { method: 'PUT' },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#View-a-Subscriber-Features-Detail
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * View-a-Subscriber-Features-Detail
+      **/
+      'View-a-Subscriber-Features-Detail': {
+        method: 'GET',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Read-Subscriber-uplink_speed
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Read-Subscriber-uplink_speed
+      **/
+      'Read-Subscriber-uplink_speed': {
+        method: 'GET',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/uplink_speed/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Update-Subscriber-uplink_speed
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Update-Subscriber-uplink_speed
+      **/
+      'Update-Subscriber-uplink_speed': {
+        method: 'PUT',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/uplink_speed/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Read-Subscriber-downlink_speed
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Read-Subscriber-downlink_speed
+      **/
+      'Read-Subscriber-downlink_speed': {
+        method: 'GET',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/downlink_speed/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Update-Subscriber-downlink_speed
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Update-Subscriber-downlink_speed
+      **/
+      'Update-Subscriber-downlink_speed': {
+        method: 'PUT',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/downlink_speed/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Read-Subscriber-cdn
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Read-Subscriber-cdn
+      **/
+      'Read-Subscriber-cdn': {
+        method: 'GET',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/cdn/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Update-Subscriber-cdn
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Update-Subscriber-cdn
+      **/
+      'Update-Subscriber-cdn': {
+        method: 'PUT',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/cdn/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Read-Subscriber-uverse
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Read-Subscriber-uverse
+      **/
+      'Read-Subscriber-uverse': {
+        method: 'GET',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/uverse/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Update-Subscriber-uverse
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Update-Subscriber-uverse
+      **/
+      'Update-Subscriber-uverse': {
+        method: 'PUT',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/uverse/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Read-Subscriber-status
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Read-Subscriber-status
+      **/
+      'Read-Subscriber-status': {
+        method: 'GET',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/status/'
+      },
+      /**
+      * @ngdoc method
+      * @name xos.helpers.Subscribers#Update-Subscriber-status
+      * @methodOf xos.helpers.Subscribers
+      * @description
+      * Update-Subscriber-status
+      **/
+      'Update-Subscriber-status': {
+        method: 'PUT',
+        isArray: false,
+        url: '/api/tenant/cord/subscriber/:id/features/status/'
+      }
+    })
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Tenant.js b/src/services/rest/Tenant.js
new file mode 100644
index 0000000..8feb102
--- /dev/null
+++ b/src/services/rest/Tenant.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Tenant
+  * @description Angular resource to fetch /api/core/tenant/:id/
+  **/
+  .service('Tenants', function($resource){
+    return $resource('/api/core/tenants/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Truckroll.js b/src/services/rest/Truckroll.js
new file mode 100644
index 0000000..7af9016
--- /dev/null
+++ b/src/services/rest/Truckroll.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Truckroll
+  * @description Angular resource to fetch /api/tenant/truckroll/:id/
+  **/
+  .service('Truckroll', function($resource){
+    return $resource('/api/tenant/truckroll/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
diff --git a/src/services/rest/Users.js b/src/services/rest/Users.js
new file mode 100644
index 0000000..8be0fdd
--- /dev/null
+++ b/src/services/rest/Users.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Users
+  * @description Angular resource to fetch /api/core/users/:id/
+  **/
+  .service('Users', function($resource){
+    return $resource('/api/core/users/:id/', { id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/Utility.js b/src/services/rest/Utility.js
new file mode 100644
index 0000000..a735c46
--- /dev/null
+++ b/src/services/rest/Utility.js
@@ -0,0 +1,21 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Login
+  * @description Angular resource to fetch /api/utility/login/
+  **/
+  .service('Login', function($resource){
+    return $resource('/api/utility/login/');
+  })
+  /**
+  * @ngdoc service
+  * @name xos.helpers.Logout
+  * @description Angular resource to fetch /api/utility/logout/
+  **/
+  .service('Logout', function($resource){
+    return $resource('/api/utility/logout/');
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/vOLT.js b/src/services/rest/vOLT.js
new file mode 100644
index 0000000..424c48d
--- /dev/null
+++ b/src/services/rest/vOLT.js
@@ -0,0 +1,15 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.vOLT-Collection
+  * @description Angular resource to fetch /api/tenant/cord/volt/:volt_id/
+  **/
+  .service('vOLT-Collection', function($resource){
+    return $resource('/api/tenant/cord/volt/:volt_id/', { volt_id: '@id' }, {
+      update: { method: 'PUT' }
+    });
+  })
+})();
\ No newline at end of file
diff --git a/src/services/rest/vSG.js b/src/services/rest/vSG.js
new file mode 100644
index 0000000..121b5a3
--- /dev/null
+++ b/src/services/rest/vSG.js
@@ -0,0 +1,13 @@
+(function() {
+  'use strict';
+
+  angular.module('xos.helpers')
+  /**
+  * @ngdoc service
+  * @name xos.helpers.vSG-Collection
+  * @description Angular resource to fetch /api/service/vsg/
+  **/
+  .service('vSG-Collection', function($resource){
+    return $resource('/api/service/vsg/');
+  })
+})();
\ No newline at end of file
diff --git a/src/services/service_graph.service.js b/src/services/service_graph.service.js
new file mode 100644
index 0000000..8a732a2
--- /dev/null
+++ b/src/services/service_graph.service.js
@@ -0,0 +1,44 @@
+(function() {
+  'use strict';
+
+  /**
+  * @ngdoc service
+  * @name xos.helpers.ServiceGraph
+  * @description This factory define a set of helper function to query the service tenancy graph
+  **/
+
+  angular
+  .module('xos.helpers')
+  .service('GraphService', function($q, Tenants, Services) {
+
+    this.loadCoarseData = () => {
+
+      let services;
+
+      let deferred = $q.defer();
+
+      Services.query().$promise
+      .then((res) => {
+        services = res;
+        return Tenants.query({kind: 'coarse'}).$promise;
+      })
+      .then((tenants) => {
+        deferred.resolve({
+          tenants: tenants,
+          services: services
+        });
+      })
+
+      return deferred.promise;
+    }
+
+    this.getCoarseGraph = () => {
+      this.loadCoarseData()
+      .then((res) => {
+        console.log(res);
+      })
+      return 'ciao';
+    };
+
+  })
+})();