api6- added trys and catches