1 - have you used the 'count' parameter ?
2 - I have the same problem regarding getting some informations about a file : the queryFolder API service accepts a search pattern in its 'query' parameter, but this presents limitations.
Imagine you have a folder with 3 files 'foo', 'foo1', foo10'.
Querying folder with query='foo' returns 3 files.
Querying folder with query='foo1' returns 2 files (foo1, foo10).
So if you have a folder containing many fooXXXX files, how do you retrieve 'foo' ?
I have encountered other limitations as well, if filename contains unusual characters : queryFolder may return several results, or no result at all (ie if filename contains a '*')...