removed need for errors
simplified api code