Added timeout handling, changes on the api service.