preparation for api