Add a bunch more apis, and a dsl for writing them.