graceful exit

finish serving requests and close DB connection before quitting