def getDrugs(api, filename):
    if (filename is None):
        drugs = getDrugsMapping(api)
    elif os.path.isfile(filename):
        with open(filename, 'r') as drug_file:
            drugs = json.loads(drug_file.read())
    else:
        drugs = getDrugsMapping(api)
        with open(filename, 'w') as drug_file:
            drug_file.write(json.dumps(drugs))
    return drugs
def getDrugs(api, filename):
    if (filename is None):
        drugs = getDrugsMapping(api)
    elif os.path.isfile(filename):
        with open(filename, 'r') as drug_file:
            drugs = json.loads(drug_file.read())
    else:
        drugs = getDrugsMapping(api)
        with open(filename, 'w') as drug_file:
            drug_file.write(json.dumps(drugs))
    return drugs