Fix middleware and add README