added get length to api