Got things working a bit better in the API