Adding tests for api.js
Adding getBadge tests
Merge pull request #178 from stenington/api-test

api.js tests