more complete API now, still need docs and need to port the crypto bit