api: fixes for windows (to finish)