hunk.code_window:         state.loading = false;
           deferred.resolve(state);
         } else {
           Config.$promise.then(function success(data) {
             state.application.authentication = data.authentication;
             state.application.logo = data.logo;
             LocalStorage.storeApplicationState(state.application);
             state.loading = false;
             deferred.resolve(state);
           }, function error(err) {
  
hunk.labels: keep keep keep keep add keep keep keep keep keep
hunk.after_edit:           state.application.analytics = data.analytics;
  
hunk.file_path: app/services/stateManager.js
hunk.type: add
file: angular.module('portainer.rest')
  .factory('Endpoints', ['$resource', 'ENDPOINTS_ENDPOINT', function EndpointsFactory($resource, ENDPOINTS_ENDPOINT) {
    'use strict';
    return $resource(ENDPOINTS_ENDPOINT + '/:id/:action', {}, {
      create: { method: 'POST' },
      query: { method: 'GET', isArray: true },
      get: { method: 'GET', params: { id: '@id' } },
      update: { method: 'PUT', params: { id: '@id' } },
      remove: { method: 'DELETE', params: { id: '@id'} },
      getActiveEndpoint: { method: 'GET', params: { id: '0' } },
      setActiveEndpoint: { method: 'POST', params: { id: '@id', action: 'active' } }
    });
  }]);
  