refactoring of json_server class