Add inventory management features
Fix some bugs in frontend