The treasurer of each city where depositories have been designated in accordance with sections 427.02 to 427.07 shall keep the funds of the city as far as possible in the depositories so designated and when so deposited the treasurer and the sureties on the official bond of such treasurer shall be exempt from all liability for the loss of any such funds so deposited as provided in sections 427.02 to 427.07, if such loss is caused by the failure, bankruptcy, or any other act of default of such depository.