Rough javascript api wrapper