change local doc api to use separate struct