Better content-type support and tests
Use $resource instead of $http