First attempt at an API

callback hell? :(