parse the JSON response in the client and append correctly