Added and used error method in JsonValue class