Update pdf textbooks backend to respond to AJAX requests with JSON