add distance api