added getDirection to API