Begin adding debug statements plus slight cleanup

Cleaned up a few really old, unused lines. Modified most of the server responses to return JSON relevant to the URL path (more in line with a RESTful API). Added print statements to existing catch blocks. Modified the structure of a few serial calls to allow better division into try-catch-finally blocks. Added commented out print statements for denoting beginning and end of sections in main loop. These statements can be uncommented to allow cleaner partitioning of verbose debug logging.