added pid endpoint, return pid