fix api for better calling semantics