decode the json instead of guessing a buffer size for it