     apply(__MODULE__, type, [{type, event}, model, new_events])
   end
 
-  def start_user(user, event, %{"status" => :stopped} = user_model) do
-    {user, user_model
-    |> Map.put("status", :running)
+  def start_user(user, event, %{"status" => "stopped"} = user_model) do
+    {user, user_model
+    |> Map.put("status", "running")
     |> Map.put("start_time", event.timestamp)}
   end
 
   def start_user(user, event, user_model) when map_size(user_model) == 0 do
     {user, user_model
-    |> Map.put("status", :running)
+    |> Map.put("status", "running")
     |> Map.put("start_time", event.timestamp)}
   end
 

    {new_model, create_stats_event(stats_type(new_model["challenge_type"]), new_model, new_events)}
  end

  def edit_user(user, _event, %{"status" => :deleted} = user_model, _benchmark), do: {user, user_model}
  def edit_user(user, event, user_model, benchmark) do
    actual_units = event.data["units"] / length(event.data["users"])
    uph = actual_units / (event.data["mins"] / 60)
    percentage = uph/ benchmark

    {user, user_model
        |> Map.put("status", :editted)
        |> Map.put("active_seconds", event.data["mins"] * 60)
        |> Map.put("actual_units", actual_units)
        |> Map.put("uph", uph)


  def delete_user(user, _event, user_model) do
    new_model = user_model
        |> Map.put("status", "deleted")
        |> Map.drop(["active_seconds", "actual_units", "uph", "percentage"])
    {user, new_model}
  end
