simplyfing the api

make the api more robust!