improved legion_action api