moving success/error callbacks into $apply
Merge remote-tracking branch 'origin/master'