Finished rough version of API.