Wrote a more complete API