* Fixes and timeout added to error handling.
* Improved api calling method