fix id conflict for empty POST and invalid JSON