Add content-type headers to server responses. Client-side JQuery automatically parses JSON
Fix button event handling by moving JQuery element lookups to inside $(document).ready.