modify some typo and fix the bug in extending namespace
reformat js-restful api code and add some comments