build api, fix new ui bugs, speical thanks to @JeromeWu