I think we should improve this code, i mean: we have the strings "max=" and "account=" duplicated, besides their sizes are hardcoded. uri.find("&"...) is also duplicated.
what about adding "max" and "account" to an array of known parameters? we may copy the values into an map<string,string> as their are decoded, then the specific parameter logic (eg. lexical_cast) would be moved out of the parameters parsing loop.
The map<> is just an idea, the actual parsing loop implementation may differ. I just wanted to have this better refactored for future expandability.