json_encoded query response and fixed typo