[TASK] Replaced error! with api helper function