update server code and sql scripts