Give error if json file does not contain an object