'json_string is basicly string that you give to json.loads method'

def decode(self, json_string):

    default_obj = super(ResourceBaseMangler, self).decode(json_string)
    upload_sessions = []
    for obj in default_obj:
        obj['pk'] = (obj['pk'] + self.basepk)
        obj['fields']['owner'] = [self.owner]
        if ('distribution_url' in obj['fields']):
            if ((not (obj['fields']['distribution_url'] is None)) and ('layers' in obj['fields']['distribution_url'])):
                try:
                    p = '(?P<protocol>http.*://)?(?P<host>[^:/    ]+).?(?P<port>[0-9]*)(?P<details_url>.*)'
                    m = re.search(p, obj['fields']['distribution_url'])
                    if ('http' in m.group('protocol')):
                        obj['fields']['detail_url'] = (self.siteurl + m.group('details_url'))
                    else:
                        obj['fields']['detail_url'] = (self.siteurl + obj['fields']['distribution_url'])
                except:
                    obj['fields']['detail_url'] = obj['fields']['distribution_url']
        upload_sessions.append(self.add_upload_session(obj['pk'], obj['fields']['owner']))
    default_obj.extend(upload_sessions)
    return default_obj
