WIP: Clean the API endpoints and document it using selfapi
This MR aims at cleaning the API endpoint to something that could become an official v1 API, documented and usable by the user. This is currently a WIP, as it will break a few things in the process (Kresus is currently broken as opening this MR).
This MR requires !431 (merged) and !435 (merged) and should then be merged after them (first commits of this MR are actually the ones from these other MRs). I am splitting these changes across two MRs to be able to merge quite quickly !431 (merged), while this one will require more work.