Code cleanup: eliminating duplication of code inherited from very early
versions, remove extra object types that are used only once and put in
the API response handlers, work in progress