update async api to use types