[api] move all patchinfo specific code into a patchinfo model