AJAX calls not working correctly — still troubleshooting