added cards edit template and cleaned up cards controller