You basically want to abstract the asynchronous nature of file processing operations in your API.
This can be done, I would recommend you take a look at the following article:
The article is written by Dustin Diaz, who is currently working on the @ everywhere JavaScript API , and it does exactly what you want, using a simple Queue implementation, you can create a free interface that is independent of any callback.
, API, .