Some bug fix

* carelessly implemented DELETE method problem
* いくつかのバグ修正
* Code cleanup.