cleaning up the AJAX call and printing to screen