Handle deleted items properly in backend

It also makes the orders soft deletable.