backend: use goroutines to fix blocking bug