[engine] Throw SyntaxError for empty and malformed JSON files