build object given a set of paths and values