Add AJAX callback and "new item" logic #3951

#3951 

Ready for review