<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def blacklist(self, term=None):
 """List blacklisted entries. When no term is given, the method will list the entries that exist in the blacklist. If 'term' is set, the method will list only those entries that match with that term. :param term: term to match """

        try:
            bl = api.blacklist(self.db, term)
            self.display('blacklist.tmpl', blacklist=bl)
        except NotFoundError as e:
            self.error(str(e))
            return e.code

        return CMD_SUCCESS