Snapchat API wrapper in JavaScript