finished up the api