Fix error in inventory response; fix db error