Use proper AJAX methods in client JS