made some changes to api syntax as per ryan's recommendations