     end
   end
 
-
   def get_resource(id) do
 
     case HTTPoison.get("#{@get_base_url}/#{id}") do
 
       {:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
         body
-        |> Poison.decode!
-        |> atomize
+        |> to_atomized_result
         |> to_resource
 
       {:ok, %HTTPoison.Response{status_code: 404}} ->

    end
  end


  defp to_hits(%{ hits: %{ hits: hits }}), do: hits



      {:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
        body
        |> to_atomized_result
        |> to_hits
        |> Enum.map(&to_resource/1)

