add apidoc and implementation