Added getSelfLoops function in GraphApi.