'Writes data to file as JSON.  Returns True.'

def write_to_cache(self, data, filename=''):

    if (not filename):
        filename = self.cache_path_cache
    json_data = json.dumps(data)
    with open(filename, 'w') as cache:
        cache.write(json_data)
    return True
