It means your column names aren't valid JSON identifiers, so you get invalid json when specifying json return format.
Change the column names your query returns to conform. For best results, make them have only letters, digits, and underscores, and not start with a digit. No spaces, no other punctuation.