apiservice.js

angular.module('homepage').
factory('Server', function($http) {
    return {
		fblogin : function() {
			return $http.get('/auth/user/facebook');
		},
        login   : function(user) {
            return $http.post('/auth/user/login', user);
        },
        logout  : function() {
            return $http.get('/auth/user/logout');
        },
        register: function(data) {
            return $http.post('/auth/user/register', data);
        },
        signup: function(data) {
            return $http.post('/auth/user/signup', data);
        },
        checkInvite: function (data) {
            return $http.put('/auth/user/checkinvite', data);
        },
        addcomment: function (data) {
            return $http.post('/api/comment/add', data);
        },
        ibsubmit: function (data) {
            return $http.post('/api/inputbox/submit', data);
        },
        markTemplate: function (data) {
            return $http.post('/api/inputbox/habit/mark', data);
        },
        getTemplates: function (data) {
            return $http.post('/api/inputbox/gettemplates', data);
        },
        getDemoData: function () {
            return $http.post('/api/inputbox/getdemodata', {});
        },
        getNotesData: function (data) {
            return $http.post('/api/inputbox/notes/getdata', data);
        },
        getMoneyData: function (data) {
            return $http.post('/api/inputbox/finance/getdata', data);
        },
        getMoneyWidgetData: function (data) {
            return $http.post('/api/inputbox/finance/widget/getdata', data);
        }
	};
});