more migrations and write support for api