API extended to accept C-style strings with length