javascript wrapper for our API