Dyn: refactored duplicated code into api_ methods