Writes first card submission function and socket emit.