Implementing PUT and HEAD methods, minor code style changes