 
  # Valid json goes here and need to parse valid string
   def format_render_response(conn, %{response_body: a_body},  %{response_body: today_body} ) do
+    IO.puts a_body
     response = Poison.Parser.parse!(a_body)
-    IO.puts response["city"]["name"]
     conn
     |> assign(:w_data, response["list"])
     |> assign(:today, today_body)

    |> parse_response
  end

  def weather_url_today(city, format \\ "html", unit \\"metric") do
    "#{@weather_url_api_today}?q=#{city}&mode=#{format}&units=#{unit}&&APPID=#{@api_token}"
  end

  def weather_url(city, format \\ "json", unit \\"metric", number_of_days \\ 3 ) do
    "#{@weather_url_api}?q=#{city}&mode=#{format}&cnt=#{number_of_days}&units=#{unit}&&APPID=#{@api_token}"
  end

  def parse_response({:ok, %HTTPoison.Response{status_code: 200, body: body}}) do
    #IO.puts body
    parse_body(body)
  end




  def parse_response({:ok, %HTTPoison.Response{status_code: 404, body: a_body }}) do
    %{:error_message => "No weather data is available for this city"}
  end

