getting data into object from endpoint lookup and from JSON