json refactoring in ServerInterface.hs