Added pointer support for JSON middleware, will look into the possible race condition as discussed