added unittest for category, validation for type_id