Fixed Write bug in API & periodic WIP