some improvement to call api