[api] some fixes for migrations