fixing server code to take in request headers