         annotation = Repo.preload(annotation, :annotation_tags)
         conn
         |> render("show.json", annotation: annotation)
+
       {:error, changeset} ->
         conn
         |> put_status(:unprocessable_entity)

    end
  end

  def show(conn, %{"id" => _}) do
    annotation = conn.assigns[:annotation]
    |> Repo.preload(:annotation_tags)


  plug :find when action in [:update, :delete, :show]
  plug Core.Auth, %{key: :annotation,
                    type: "annotations"} when action in [:create, :update, :delete]

  def index(conn, _params) do
    annotations = Repo.all(Annotation)
    render(conn, "index.json", annotations: annotations)
  end

  def create(conn, annotation_params) do
    user = Guardian.Plug.current_resource(conn)
    changeset = user
    |> build_assoc(:annotations)
