 
   def reload_nginx_container(resource_uri) do
     path = "#{resource_uri}exec/?command=nginx%20-s%20reload"
-    Socket.Web.connect! @wss_address, path: path, api_key: @api_key, secure: true, custom_headers: %{Authorization: @api_key}
+    Socket.Web.connect! @wss_address, path: path, secure: true, custom_headers: %{Authorization: api_key}
   end
 
   defp request(url) do
     case HTTPoison.get("#{@api_address}#{url}", [
-      "Authorization": @api_key, 
+      "Authorization": api_key, 
       "Accept": "application/json"
     ]) do
       {:ok, %HTTPoison.Response{status_code: 200, body: body}} ->

        IO.puts "Websocket connection closed"
    end
  end
end

        body
        |> Poison.decode!
        |> Map.get("objects")
        |> Enum.filter(fn(s) -> Map.get(s, "name") === nginx_service_name end)
        |> List.first
        |> Map.get("resource_uri")
        |> get_service
