modified some api and migration