More explicit var names, added isJSONy check (this can be tested further in future as needed)