handle optional init function to server
update doc