converting edges service to factory and using ngResource, wip...