Add some of the code needed to handle upstream requests.