make api async (wip)