Working category API with angular $resource.