Add basic patches handling function server-side