adds middleware and help docs