Switched  stock API

new api
cleanup
fixed minor issues
minified