Initial work on a better API.