moved functional API to prototypal API