Removing screenshotonfail from api and unnecessary function call