[api] raise correct error when using same architecture multiple time for a repository (no crash)