generate JSON using standard library