Product API and fix some bugs