cleanup
implementing javascript api
implementing javascript api