moved pipe functions onto incoming req/res (progress #109)