Added frokApiAlloc error handling