prototype works
encoding json and escapes