[api] fix file permissions
[api] fix repository index migration