REST API timeout code