change middleware function name to serve