extend Relation and Resource for PATCH operation

fix test
implement PATCH