Updated from_json() to be a class method