Support of flag "autoAddReplicas" in collection api

Refactoring and added autoAddReplica argument to collections api