move allocateIds to request & generate docs.

This function handles all routes now.