completed basic server with upload func