prepare everything before starting server