Add api.js for ajax call routes
More error handling for JSON parsing and other tweaks.

Moved requestTopArtists to utilities. I think there needs to be another
class for these things which use deferred objects to normalize an async
response - they return either stored data or make an ajax request.