Adding some logic related adding and update function for Category.