Search and Timeline rewrite with $resource instead of $http