Wrote the start of the express middleware, tweaks to support it