initial request handling code