Swaps out the bits of code to be more node like and sends errors first, then response if success