substr in C++ needs initial position to be in range
simplify json request syntax so that ?req=... in url implies json format