added second embedded filepointer to API functions