Add filtering support for branch names to the API

Test Plan: make test

Reviewers: cramer

Reviewed By: cramer

Maniphest Tasks: T10537

Differential Revision: https://tails.corp.dropbox.com/D61944