fix Endpoint JSON serialization