Set some secure default headers, and type checks in main.js

I noticed when I submitted a github url that the summarize response didn't necessarily return a value for summary so I added checks for each of the values.