Replace $http with $resource
Add server-side validation
Added Client-side validation