 
     transformed_results = api_results["results"]
     |> Enum.map(fn(movie) -> Enum.reduce(movie, %{}, &transform_api_results/2) end)
+    
+    transformed_results
     |> Enum.each&insert_movie/1
+
+    transformed_results
   end
 
   def get_database_movies do

  end

  def get_api_movies(path) do
    HTTPotion.start
    api = Application.get_env(:similarfilms_phoenix, SimilarfilmsPhoenix.ApiKey)[:moviedb_api_key]
    host = "api.themoviedb.org"

  end

  def get_data(path) do
    database_movies = get_database_movies
    movies = if (length(database_movies) < 1) do
       get_api_movies(path) || []
    else
      database_movies
    end
  end
end