Implemented $resource

but haven't merged it with backend completely.