refactored application to use Angular modules and added angular-resource dependency