added serve functionality