rewrote /spawn to use the API