adapt to API