brandonaaskov/Swayze — pull request #1 by ehynds (2012-06-06 00:37:24+00:00)
Title: Handle errors gracefully. This commit does the following:

- If the analytics API returns an error, send that back as JSON instead of failing
- If the analytics API responds with a status error, wrap that error into a JSON string with an error key
- Reduce nested functions by passing references directly