Apply changes including fixing JS formatting, adding error handling for AJAX calls, removing unused code, and applying minor styling tweaks