added cors library
moved from cors to trial and error
adding logging
resolved the 502 error -- update returns the number of documents changed and *not* the object(s) changed