Using correct mime type for json format. Fixes #1
Escaping new lines