added base widget js
added base test to index
adding JSON.parse to api method
fixing bugs in widget js