adding timeout capability to the API