Helpers for the JSON streaming