Adding type hint to Api/ONERROR