* add error as value to rejected deferrerds
* correct usage of when.all
* formatting