Removed cruft, added differentiation between flatpack and json requests