I could use the Content Server rest api cs/api/v1/nodes/2000?where_name=filename that will return the file if exists in Enterprise Workspace and not in subfolders.
How should I use the api to search even the subfolders (subnodes) for a file.
The /nodes/:id/nodes?where_name=something filters children of a single container with the specified id by their name. There is no CS REST API for your use case right now. Traversing the child containers one by one would be too slow, I'm afraid.
/nodes/:id/nodes?where_name=something
id
You could use the search API for this task. However, there is no full-text or meta-data CS Search REST API for your use case either. You can use the CS XML Search API today. The first version of the CS Search REST API should be released in June 2014.