restructure to prepare displaying wait screen during API call