now accepts middleware and supports express4