Add AJAX functionality to calculator