move http error handling to directive
make everything a coffee script