Refactored the category creation javascript code + added field to category model