updated example & a couple of tidy ups to throw API_Exception rather than legacy