escape newlines, json doesnt like them