rewrited API - functions returns errors, memcopy is now unified