rework api generation, so it can be built independent of a http implementation;
flesh out kv callbacks