Various fixes to correctly call parts of the API