DRYed up the code with a generic json responder
Moved test file to coffeescript