Updated back-end to use angular functions instead of jQuery.