 
       @doc """
         A Farmbot Syncable #{unquote name}
+        Will either return:
+        {:ok, #{unquote name}}  or
+        {#{unquote name}, reason}
       """
-      def create(unquote(a)), do: {:ok, unquote(b)}
+      @spec create({:ok, map} | map) :: {:ok, t} | {unquote(name), atom}
+      def create(unquote(json_map)), do: {:ok, unquote(module_struct)}
       def create({:ok, t}), do: create(t)
       def create(map) when is_map(map) do
         missing = model -- Map.keys(map)

           {:ok, %BubbleGum{flavors: ["mint", "berry"], brands:  ["BigRed"]}}
  """
  defmacro __using__(name: name, model: model) do
    fa =
    Enum.map(model, fn(k) ->
      key = inspect(k)
       <<":", rkey :: binary>> = key
      {rkey, {:var!, [], [{k, [], nil}]}}
    end)

    fb =
    Enum.map(model, fn(k) ->
      # val = {k, [], nil}
      # val = thing(k, {k, [], nil})
      val = quote do mutate(unquote(k), unquote({k, [], nil}) ) end
      {k, val}
    end)

    a = {:%{}, [], fa}
    b = {:%, [], [{:__aliases__, [], [name]}, {:%{}, [], fb}]}

    quote do
      import Syncable
      @moduledoc """

      end
      def create(_), do: {unquote(name), :malformed}

      @doc """
        Same as create\1 except it returns successfully or raises an runtime exception.
      """
      @spec create!({:ok, map} | map) :: t
      def create!(t) do
        case create(t) do
          {:ok, thing} ->
            thing
          {unquote(name), reason} ->
            raise("#{inspect(unquote(name))} #{inspect(reason)} expecting: #{inspect model}")
        end
      end

      @doc """
        The required keys to build a #{unquote(name)} object.
      """
      @spec model :: [atom]
      def model, do: @enforce_keys

      # This ties into that transform macro.
      @spec mutate(atom, any) :: any
      defp mutate(_k, v), do: v
      defoverridable [mutate: 2]
    end
  end

  @doc """
    Transforms the state before it is entered into the struct.
    Basically you call transform(key) do something end where something will be
    the new value for key.
    Example:
      Iex> defmodule Dog do
      ...>  use Syncable, name: __MODULE__, model: [:legs]
      ...>  transform :legs do
      ...>    new_thing = before + 1
      ...>    IO.puts "This probably isnt a dog anymore?"
      ...>    new_thing
      ...>  end
      ...> end
      Iex> Dog.create!("legs" => 4)
           This probably isnt a dog anymore?
           %Dog{legs: 5}
  """
  defmacro transform(key, block) do
    quote do
      defp mutate(unquote(key), var!(before)), unquote block
