diff --git a/xos/synchronizer/steps/.gitignore b/xos/synchronizer/steps/.gitignore
new file mode 100644
index 0000000..c649235
--- /dev/null
+++ b/xos/synchronizer/steps/.gitignore
@@ -0,0 +1 @@
+synchronizers
\ No newline at end of file
diff --git a/xos/synchronizer/steps/helpers.py b/xos/synchronizer/steps/helpers.py
index d52422b..8f07a66 100644
--- a/xos/synchronizer/steps/helpers.py
+++ b/xos/synchronizer/steps/helpers.py
@@ -15,6 +15,8 @@
 from xosconfig import Config
 from multistructlog import create_logger
 from synchronizers.new_base.modelaccessor import ProgranService
+import time
+import datetime
 
 log = create_logger(Config().get('logging'))
 
@@ -30,7 +32,7 @@
         try:
             progran_service = ProgranService.objects.all()[0]
         except IndexError:
-            log.error("Cannot find Progran Service, does it exists?")
+            raise Exception("Cannot find Progran Service, does it exists?")
         return ProgranHelpers.get_onos_info_from_service(progran_service)
 
     @staticmethod
@@ -41,3 +43,43 @@
             'username': progran_service.onos_username,
             'password': progran_service.onos_password,
         }
+
+    @staticmethod
+    def get_progran_rest_errors(res):
+        res = res.json()
+        if res['Result'] == -2:
+            raise Exception(res['ErrCode'])
+
+    @staticmethod
+    def date_to_time(d):
+        if len(d) == 0:
+            return 0
+        return time.mktime(datetime.datetime.strptime(d, "%d.%m.%Y %H:%S").timetuple())
+
+    @staticmethod
+    def update_fields(model, dict, mapping={}, transformations={}):
+        dict = ProgranHelpers.convert_keys(dict, mapping, transformations)
+        for k, v in dict.iteritems():
+            if hasattr(model, k):
+                setattr(model, k, v)
+            else:
+                log.warn("%s does not have a '%s' property, not updating it" % (model.model_name, k))
+        return model
+
+    @staticmethod
+    def convert_keys(dict, mapping={}, transformations={}):
+        for k, v in dict.iteritems():
+            if k in mapping:
+                # apply custom transformations to the data
+                if k in transformations:
+                    dict[k] = transformations[k](v)
+
+                # NOTE we may have different names that the field in the dict
+                dict[mapping[k]] = dict[k]
+                del dict[k]
+        return dict
+
+    @staticmethod
+    def list_diff(first, second):
+        second = set(second)
+        return [item for item in first if item not in second]
\ No newline at end of file
diff --git a/xos/synchronizer/steps/sync_imsi.py b/xos/synchronizer/steps/sync_imsi.py
index c76dafb..93af41f 100644
--- a/xos/synchronizer/steps/sync_imsi.py
+++ b/xos/synchronizer/steps/sync_imsi.py
@@ -78,6 +78,7 @@
         self.run_playbook(o, create_fields)
 
         # fetch the IMSI we just created
+        # NOTE we won't need this method once we'll have polling in place
         imsi_url = "http://%s:%s/onos/progran/imsi/%s" % (base_fields['onos_url'], base_fields['onos_port'], o.imsi_number)
         r = requests.get(imsi_url)
         o.ue_status = r.json()['ImsiArray'][0]['UeStatus']
diff --git a/xos/synchronizer/steps/sync_progranserviceinstance.py b/xos/synchronizer/steps/sync_progranserviceinstance.py
index 14925bc..11d679d 100644
--- a/xos/synchronizer/steps/sync_progranserviceinstance.py
+++ b/xos/synchronizer/steps/sync_progranserviceinstance.py
@@ -17,14 +17,15 @@
 import os
 import sys
 from synchronizers.new_base.SyncInstanceUsingAnsible import SyncStep
-from synchronizers.new_base.ansible_helper import run_template
-from synchronizers.new_base.modelaccessor import ProgranServiceInstance, ENodeB
+from synchronizers.new_base.modelaccessor import ProgranServiceInstance, ENodeB, Handover
 
 from xosconfig import Config
 from multistructlog import create_logger
 import json
 import requests
 from requests.auth import HTTPBasicAuth
+import time
+import datetime
 
 
 log = create_logger(Config().get('logging'))
@@ -39,6 +40,9 @@
 
     observes = ProgranServiceInstance
 
+    # Poll every 5 loops of self.call
+    poll = 0
+
     def sync_record(self, o):
         onos = ProgranHelpers.get_progran_onos_info()
 
@@ -48,6 +52,8 @@
         data = self.get_progran_profile_field(o)
 
         r = requests.post(profile_url, data=json.dumps(data), auth=HTTPBasicAuth(onos['username'], onos['password']))
+
+        ProgranHelpers.get_progran_rest_errors(r)
         log.info("Profile synchronized", response=r.json())
 
         log.info("sync'ing enodeb", object=str(o), **o.tologdict())
@@ -60,6 +66,7 @@
                 ]
             }
             r = requests.post(enodeb_url, data=json.dumps(data), auth=HTTPBasicAuth(onos['username'], onos['password']))
+            ProgranHelpers.get_progran_rest_errors(r)
             o.active_enodeb_id = o.enodeb_id # storing the value to know when it will be deleted
             log.info("EnodeB synchronized", response=r.json())
         elif o.active_enodeb_id:
@@ -67,12 +74,12 @@
             log.info("removing profile %s from enodeb %s" % (o.name, o.active_enodeb_id), object=str(o), **o.tologdict())
             enodeb_url = "http://%s:%s/onos/progran/enodeb/%s/profile/%s" % (onos['url'], onos['port'], enb_id, o.name)
             r = requests.delete(enodeb_url, auth=HTTPBasicAuth(onos['username'], onos['password']))
+            ProgranHelpers.get_progran_rest_errors(r)
             o.active_enodeb_id = 0 # removing the value because it has been deleted
             log.info("EnodeB synchronized", response=r.json())
 
         o.save()
 
-
     def get_handover_for_profile(self, o):
         return {
             "A3Hysteresis": o.handover.HysteresisA3,
@@ -114,4 +121,106 @@
         profile_url = "http://%s:%s/onos/progran/profile/%s" % (onos['url'], onos['port'], o.name)
         r = requests.delete(profile_url, auth=HTTPBasicAuth(onos['username'], onos['password']))
         o.active_enodeb_id = 0  # removing the value because it has been deleted
-        log.info("Profile synchronized", response=r.json())
\ No newline at end of file
+        log.info("Profile synchronized", response=r.json())
+
+    def fetch_pending(self, deleted):
+        # self.read_profiles_from_progran()
+        return super(SyncProgranServiceInstance, self).fetch_pending(deleted)
+
+    @staticmethod
+    def date_to_time(d):
+        if len(d) == 0:
+            return 0
+        return time.mktime(datetime.datetime.strptime(d, "%d.%m.%Y %H:%S").timetuple())
+
+    @staticmethod
+    def update_fields(model, dict, mapping={}, transformations={}):
+        dict = SyncProgranServiceInstance.convert_keys(dict, mapping, transformations)
+        for k, v in dict.iteritems():
+            if hasattr(model, k):
+                setattr(model, k, v)
+            else:
+                log.warn("%s does not have a '%s' property, not updating it" % (model.model_name, k))
+        return model
+
+    @staticmethod
+    def convert_keys(dict, mapping={}, transformations={}):
+        for k, v in dict.iteritems():
+            if k in mapping:
+                # apply custom transformations to the data
+                if k in transformations:
+                    dict[k] = transformations[k](v)
+
+                # NOTE we may have different names that the field in the dict
+                dict[mapping[k]] = dict[k]
+                del dict[k]
+        return dict
+
+
+    def my_call(self, failed=[], deletion=False):
+        """
+        Read profile from progran and save them in xos
+        """
+        if self.poll < 5:
+            self.poll = self.poll + 1
+        else:
+            self.poll = 0
+            onos = ProgranHelpers.get_progran_onos_info()
+            profile_url = "http://%s:%s/onos/progran/profile/" % (onos['url'], onos['port'])
+            r = requests.get(profile_url, auth=HTTPBasicAuth(onos['username'], onos['password']))
+            res = r.json()['ProfileArray']
+
+            # remove default profiles
+            res = [p for p in res if "Default" not in p['Name']]
+
+            field_mapping = {
+                'Name': 'name',
+                'Start': 'start',
+                'End': 'end'
+            }
+
+            field_transformations = {
+                'Start': SyncProgranServiceInstance.date_to_time,
+                'End': SyncProgranServiceInstance.date_to_time
+            }
+
+            handover_mapping = {
+                'A5Hysteresis': 'HysteresisA5',
+                'A3Hysteresis': 'HysteresisA3'
+            }
+
+            for p in res:
+
+                # checking for handovers
+                handover_dict = p['Handover']
+                handover_dict = SyncProgranServiceInstance.convert_keys(handover_dict, handover_mapping)
+                del p['Handover']
+
+                try:
+                    handover = Handover.objects.get(**handover_dict)
+                    log.info("handover already exists, updating it", handover=handover_dict)
+                except IndexError:
+                    handover = Handover()
+                    handover = SyncProgranServiceInstance.update_fields(handover, handover_dict)
+                    log.info("handover is new, creating it", handover=handover_dict)
+
+                handover.save()
+
+                # checking for profiles
+                try:
+                    si = ProgranServiceInstance.objects.get(name=p['Name'])
+                    log.info("Profile %s already exists, updating it" % p['Name'])
+                except IndexError:
+                    si = ProgranServiceInstance()
+                    si.name = p['Name']
+                    log.info("Profile %s is new, creating it" % p['Name'])
+
+                si = SyncProgranServiceInstance.update_fields(si, p, field_mapping, field_transformations)
+                si.handover = handover
+
+
+
+                # TODO keep track of the deleted profiles
+                # existing profiles - updated profiles = deleted profiles
+
+                si.save()
diff --git a/xos/synchronizer/steps/sync_progranserviceinstance_back.py b/xos/synchronizer/steps/sync_progranserviceinstance_back.py
new file mode 100644
index 0000000..ae97c95
--- /dev/null
+++ b/xos/synchronizer/steps/sync_progranserviceinstance_back.py
@@ -0,0 +1,126 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import os
+import sys
+
+import datetime
+import time
+
+from synchronizers.new_base.SyncInstanceUsingAnsible import SyncStep
+from synchronizers.new_base.modelaccessor import ProgranServiceInstance, ENodeB, Handover
+
+from xosconfig import Config
+from multistructlog import create_logger
+import json
+import requests
+from requests.auth import HTTPBasicAuth
+
+
+
+log = create_logger(Config().get('logging'))
+
+parentdir = os.path.join(os.path.dirname(__file__), "..")
+sys.path.insert(0, parentdir)
+sys.path.insert(0, os.path.dirname(__file__))
+from helpers import ProgranHelpers
+
+class SyncProgranServiceInstanceBack(SyncStep):
+    provides = [ProgranServiceInstance]
+
+    observes = ProgranServiceInstance
+
+
+    def call(self, failed=[], deletion=False):
+        """
+        Read profile from progran and save them in xos
+        """
+
+        if deletion == False:
+            # NOTE we won't it to run only after the delete has completed
+            return
+
+        log.info("Reading profiles from progran")
+        onos = ProgranHelpers.get_progran_onos_info()
+        profile_url = "http://%s:%s/onos/progran/profile/" % (onos['url'], onos['port'])
+        r = requests.get(profile_url, auth=HTTPBasicAuth(onos['username'], onos['password']))
+        res = r.json()['ProfileArray']
+
+        # remove default profiles
+        res = [p for p in res if "Default" not in p['Name']]
+
+        field_mapping = {
+            'Name': 'name',
+            'Start': 'start',
+            'End': 'end'
+        }
+
+        field_transformations = {
+            'Start': ProgranHelpers.date_to_time,
+            'End': ProgranHelpers.date_to_time
+        }
+
+        handover_mapping = {
+            'A5Hysteresis': 'HysteresisA5',
+            'A3Hysteresis': 'HysteresisA3'
+        }
+
+        updated_profiles = []
+
+        for p in res:
+
+            # checking for handovers
+            handover_dict = p['Handover']
+            handover_dict = ProgranHelpers.convert_keys(handover_dict, handover_mapping)
+            del p['Handover']
+
+            try:
+                handover = Handover.objects.get(**handover_dict)
+                log.info("handover already exists, updating it", handover=handover_dict)
+            except IndexError:
+                handover = Handover()
+                handover = ProgranHelpers.update_fields(handover, handover_dict)
+                log.info("handover is new, creating it", handover=handover_dict)
+
+            handover.save()
+
+            # checking for profiles
+            try:
+                si = ProgranServiceInstance.objects.get(name=p['Name'])
+                log.info("Profile %s already exists, updating it" % p['Name'])
+            except IndexError:
+                si = ProgranServiceInstance()
+                si.name = p['Name']
+
+                si.no_sync = True
+
+                log.info("Profile %s is new, creating it" % p['Name'])
+
+            si = ProgranHelpers.update_fields(si, p, field_mapping, field_transformations)
+            si.handover = handover
+
+            si.save()
+
+            updated_profiles.append(si.name)
+
+        existing_profiles = [p.name for p in ProgranServiceInstance.objects.all() if not p.is_new]
+        deleted_profiles = ProgranHelpers.list_diff(existing_profiles, updated_profiles)
+
+        if len(deleted_profiles) > 0:
+            log.info("Profiles %s have been removed in progran, removing them from XOS" % str(deleted_profiles))
+            for p in deleted_profiles:
+                si = ProgranServiceInstance.objects.get(name=p)
+                si.delete()
