necessary AJAX calls working (I think)