C API: create missing cf's, cleanup