refactoring JS code to use better names, common function to show API messages.  Removed outdated logic for view-based notifications, which broke once caching was implemented.