def METHOD_NAME(self, term, CAS):
    term = str(term).lower()
    if term in self.master_mapping.values():
        return
    try:
        result = self.process_request(
            requests.get(self.NAME_TEMPLATE.format(name=quote_plus(term)))
        )
    except (Missing, Multiple):
        if CAS:
            result = result = self.process_request(
                requests.get(self.CAS_TEMPLATE.format(cas=quote_plus(CAS)))
            )
        else:
            raise Missing
    self.master_mapping[result["canonical"].lower()] = term
    self.api_cache[result["canonical"]] = result
    if result.get("CAS"):
        self.master_mapping[result["CAS"]] = term
    for synonym in result["synonyms"]:
        if synonym in self.master_mapping:
            self.forbidden_keys.add(synonym.lower())
            del self.master_mapping[synonym.lower()]
        else:
            self.master_mapping[synonym.lower()] = term