Instead of writing the entire thing in an API, I'm using mostly a mapkey now. The API only handles looping.