(function() {
    'use strict';

    angular.module('app')
        .service('tokenService', [
            '$rootScope',
            '$http',
            '$q',
            function($rootScope, $http, $q, $location) {
                
                // var serviceBase = 'api/public/';
                var serviceBase = 'http://beta.campusbox.org/api/public/';

                
                $rootScope.config = function() {
                    return {
                        headers: {
                            'Authorization': 'Bearer ' + $rootScope.token,
                        }
                    };
                };
                var obj = {};

                obj.get = function(q) {
                    return $http.get(serviceBase + q, $rootScope.config()).then(function(results) {
                        return results.data;
                    });
                };
                obj.post = function(q, object) {
                    return $http.post(serviceBase + q, object, $rootScope.config()).then(function(results) {
                        return results.data;
                    });
                };
                obj.put = function(q, object) {
                    return $http.put(serviceBase + q, object, $rootScope.config()).then(function(results) {
                        return results.data;
                    });
                };
                obj.patch = function(q, object) {
                    return $http.patch(serviceBase + q, object, $rootScope.config()).then(function(results) {
                        return results.data;
                    });
                };
                obj.delete = function(q) {
                    return $http.delete(serviceBase + q, $rootScope.config()).then(function(results) {
                        return results.data;
                    });
                };
                return obj;
            }
        ]);
})();

@@ -249,40 +249,600 @@
  // 
-var serviceBase = 'api/public/';
+Uncomment as per usage%0A                // %0A                // before building to pushing to Beta Server %0A                // var serviceBase = '/api/public/';%0A                // %0A                // before building to pushing to Main Server %0A                // var serviceBase = 'api/public/';%0A                // %0A                // %0A                // To test locally from main API %0A                // var serviceBase = 'https://campusbox.org/dist/api/public/';%0A                // %0A                // USE THIS AT MOST TIMES%0A                // %0A                // To test locally from BETA API 
 %0A   

UPDATE TOKE FILE BEFORE DOING ANYTHING