I was just meaning put it into a separate file that you require, not talking about the api or anything, this is just a fairly standalone chunk of code