api edited for graph