```elixir
case res do
  nil -> []
  { list, _ } -> :lists.reverse(list)
end
```

What's wrong with that @josevalim ?