Adding timout functionality to the API client.