Updated with new api stuff