var URLS = {
    'heartbeat': '/api/heartbeat/',
    'species': '/api/species/',
    'magnifications': '/api/magnifications/',
    'development_stages': '/api/development-stages/',
    'probes': '/api/probes/',
    'images': '/api/images/',
    'classify': '/api/classify/',
    'subregions': '/api/subregions/',
    'image_sets': '/api/image-sets/',
    'probe_protein_map': '/api/probe-protein-map/',
    'train_model': '/api/train-model/'
};

var service = angular.module('IHCApp');

service.factory(
    'Heartbeat',
    function ($resource) {
        return $resource(
            URLS.heartbeat,
            {},
            {}
        );
    }
).factory(
    'Species',
    function ($resource) {
        return $resource(
            URLS.species,
            {},
            {}
        );
    }
).factory(
    'Magnification',
    function ($resource) {
        return $resource(
            URLS.magnifications,
            {},
            {}
        );
    }
).factory(
    'DevelopmentStage',
    function ($resource) {
        return $resource(
            URLS.development_stages,
            {},
            {}
        );
    }
).factory(
    'ImageSet',
    function ($resource) {
        return $resource(
            URLS.image_sets + ':image_set_id',
            {},
            {}
        );
    }
).factory(
    'Probe',
    function ($resource) {
        return $resource(
            URLS.probes,
            {},
            {}
        );
    }
).factory(
    'ProbeProteinMap',
    function ($resource) {
        return $resource(
            URLS.probe_protein_map,
            {},
            {}
        );
    }
).factory('Classify',
    function($resource) {
        return $resource(
            URLS.classify,
            {},
            {}
        );
    }
).factory(
    'Subregion',
    function($resource) {
        return $resource(
            URLS.subregions + ':id',
            {},
            {
                save: {
                    method: 'POST',
                    isArray: true
                }
            }
        );
    }
).factory(
    'Image',
    function ($resource) {
        return  $resource(
            URLS.images + ':id',
            {},
            {}
        );
    }
).factory(
    'TrainModel',
    function ($resource) {
        return  $resource(
            URLS.train_model + ':id',
            {},
            {}
        );
    }
);

@@ -392,24 +392,68 @@
 tein-map/',%0A
+    'onto_entities': '/api/onto-entities/',%0A
     'train_m
@@ -1667,32 +1667,222 @@
        );%0A    %7D%0A
+).factory(%0A    'OntoEntityPartOf',%0A    function ($resource) %7B%0A        return $resource(%0A            URLS.onto_entities + ':id' + '/part-of/',%0A            %7B%7D,%0A            %7B%7D%0A        );%0A    %7D%0A
 ).factory('Class

add onto-entity endpoint the client side