Add server mode and close #25