defnapi macro and some more coordiante functions