 
   defp do_api_request({method, url, body, headers, opts, from}, state) do
     alias Farmbot.System.ConfigStorage
-    token = ConfigStorage.get_config_value(:string, "authorization", "token")
-    url = ConfigStorage.get_config_value(:string, "authorization", "server") <> url
+    import ConfigStorage, only: [get_config_value: 3]
+    token = get_config_value(:string, "authorization", "token")
+    url = get_config_value(:string, "authorization", "server") <> url
 
     headers =
       headers

    do_normal_request({method, url, body, headers, opts, from}, nil, state)
  end

  defp do_normal_request({method, url, body, headers, opts, from}, file, state) do
    case HTTPoison.request(method, url, body, headers, opts) do
      {:ok, %HTTPoison.Response{status_code: code, headers: resp_headers}}
      when code in @redirect_status_codes ->

    end
  end

  defp do_multipart_request({:ok, %Response{} = res}, _, _, _), do: {:error, res}

  defp do_multipart_request({:error, reason}, _, _, _), do: {:error, reason}

  defp finish_upload(
    {:ok, %Response{status_code: code}},
    http,
    atch_url,
    meta) when is_2xx(code)
  do
    case Poison.encode(%{"attachment_url" => atch_url, "meta" => meta}) do
      {:ok, body} ->
        case request(http, :post, "/api/images", body, [], []) do
          {:ok, %Response{status_code: code} = resp} when is_2xx(code) ->
            {:ok, resp}

          {:ok, %Response{} = response} ->
            {:error, response}

          {:error, reason} ->
            {:error, reason}
        end
      err -> err
    end
  end

  defp finish_upload({:ok, %Response{} = resp}, _, _, _), do: {:error, resp}
  defp finish_upload({:error, reason}, _http, _url, _meta), do: {:error, reason}

  # GenServer
