Update for API V2

Work in progress.