Code refactoring and added first 'wait' API Request