added PUT support and rewrite hierarchy of classes