if you change to returning the http promise directly, here you return $q.reject(err);