Added json format to response
maybe try to avoid $resource and use $http or Restangular