move the json middleware