Use json.Marshal instead of Printf

I think this is more secure than original code