added js code to handle creating new products and categories ending in product and category respectively