Add server functions.
Reorganize files.