Updated scripting API