updates to server and sql for stat collecting