add path methods and spec
fix bug and add spec