completed rough draft of the api