api works with new db structure