Fix method call for generating restful url; add test