filters: open-up the filters API

Allow the API clients to add custom filters to a repository.
fixup! fix memory leaks