cf-dc-api.pl: add count_only list and search parameter; use it to self-test