update remote script to work with new api