Consuming RESTful APIs with $resource