updated the api heavily