make from_json() instance method.