changed to use angular resource plugin