Removed unnecessary boolean variables and corrected code indentation

removed chk1 ,chk2 ,chk3 variables from the file which were used to check the track and status of API's and directly used API calls in cascaded format.