not in this PR, but this thing of assigning an api object if none is passed could be factorized everywhere as a decorator