Fix potential NPE
[PLAT-3169] Various fixes, getting Historical Time Series working
Fixing bug in checking for equality of ObjectId in URL and ObjectId in query params