refactor the motion service api