refactor test and reformat code
allowed PUT method
allowed DELETE method
refactor argument http method func