[api] move code around in statushistory to make the functions less complex
[api] move all patchinfo specific code into a patchinfo model