Fixed some errors
Removed unnecessary code, improved validation of the forms
Added hook and callback to category form