added serve function