Remove: Duplicate code in API module

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Remove: Duplicate code shared across filter iters

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Merge pull request #1 from kevinconway/cleanup

Cleanup duplicate code