Rough outline of api.