Close GH-3: Generalized API. Fixes #2