AJAX working, still getting 500 error