started implementing API, added docs