add json middleware and some helpers