Updated to use API methods.