move serialize to file model, implement base64 encoding