Lots of duplication here.. also, we probably shouldn't ever need to do more than one AJAX request here.