restructure edges API and added comments