updated api to load from a "spec"