create a publicapi endpoint