if its not json, throw an error