Added support for PUT requests

Also, added code style improvements