WRT security, I recommend you skynot to use Pi (it's in the sweet-spot IMO): https://www.npmjs.com/package/skynot
I wrote it, in case you have any questions AMA.