add on listener to json api.
Include json api in build.
Pass old snapshot to 'after submit' middelware