Adapting to new API structure