implementing api, still in progress