Adds index for guid in groups and insert/update handling of new group insert also for duplicates. Also a simple timeout to delay sending of response end until hopefully all operations (which may write response) are finished.