finish all API and ui function