added graph to /spec and implemented subgraph