Complete AJAX and validations, refactor controllers