prepare for server