Moved middleware for slash / no slash routing to sep file.