Added rewrite middleware and one method.