refactor(capacities): use capacities as map as returned by server

It's simpler to use capacities as object/map as returned by the server, instead of converting it to and fro array.