Change C API to pass file contents in instead of file paths