added success and error callbacks to $resource calls to avoid discrepancies between DB and interface states