created a start function for server and repl