refactor item history API