json-response: Refactor server.hs.