modify api and config and add test