rework apiclient startup