   end
 
   def destroy(conn, %{"id" => id}) do
-    Repo.get(CloudProvider, id)
-    |> case do
+    case Repo.get(CloudProvider, id) do
       nil ->
         conn
         |> resp :not_found, ""


  # PUT "/:id"
  def update(conn, %{"id" => id} = params) do
    Repo.get(CloudProvider, id)
    |> case do
      nil ->
        conn
        |> resp :not_found, ""

    |> Repo.all
    |> Enum.map &Map.from_struct/1 

    json conn, clusters
  end
  
end
