Updated api definition and some more error handling added
1.0.5