modify ServerAPI and ServerImp to avoid null pointer exception