Refactored deserialization of server JSON responses.