added method to serve a directory, used in server