Practice to easy handle promises in angularjs