 		end
 	end
 
-	def create(conn, %{"poll_id" => poll_id, "reference" => params}, _, _) do
+	def create(conn, %{"poll_id" => poll_id, "reference" => params}) do
 		poll = Repo.get(Poll, poll_id)
 		if poll do
 			params = Map.put(params, "poll_id", poll.id)

defmodule Democracy.ReferenceController do
	use Democracy.Web, :controller
	use Guardian.Phoenix.Controller

	alias Democracy.Reference
	alias Democracy.Poll

			|> Repo.all
			|> Repo.preload([:approval_poll])
			|> Enum.filter(fn(reference) ->
				approval_result = Result.calculate(reference.approval_poll, datetime, TrustMetric.get(trust_metric_url), vote_weight_halving_days)["true"]
				is_approved = approval_result["mean"] > 0.5 and approval_result["total"] >= 1
				is_approved
			end)

