Added client and serve logic.