route api improvement
remove duplicated edge free function