initial fix of getSale and getItem middleware; needs more testing