handled AJAX Response Logic with a new template