 
     defp requests(path, multihash) do
         case get(path <> multihash) do
-            ## TODO: add more cases. 
+            ## TODO: add more cases.
             %Tesla.Env{status: 200, headers: headers, body: body} -> %{:headers => headers, :body => body}
             %Tesla.Env{status: 500, headers: headers, body: body} -> %{:headers => headers, :body => body}
             %Tesla.Env{status: 404, headers: headers} -> %{:headers=> headers, :error => "Error: 404 page not found."}
-        end 
+        end
     end
 
     defp write_file(raw, multihash) do
       File.write(multihash, raw, [:write, :utf8])
     end
-end+end

    def tour_restart do
        requests("/tour/restart", "")
    end


    defp build_url(conn, path) do

defmodule IpfsElixir.Api do

    ## TODO: add (add_cmd, block, bootstrap, config, dag, dht, diag, dns,
    ## files, id, key, log, mount, name, object, pin, ping, p2p, pubsub,
    ## bitswap, filestore, shutdown, refs, repo, resolve, stats, tar, file)

    import IpfsConnection

    ## TODO: add get_cmd for output, archive, compress and compression level
    def get_cmd(multihash) when is_bitstring(multihash) do
        requests("/get?arg=", multihash)
        ##TODO add optional file writing funcitonality.
    end

    # starts the ipfs daemon. TODO: Make this asynchronous. 
    def start do
        System.cmd("ipfs", ["daemon"])
    end

    

    def cat_cmd(multihash) when is_bitstring(multihash) do
        requests("/cat?arg=", multihash)
