move task to server, use $resource