New: Added extra methods for getting logs
Updated: encoding/decoding context array for db