reduced unneccessary api calls, fixed bug when not preserving editor annotations