inventory api fixes