writing timeapi replacement