Update req-handler to handle rewriting url