added controller with angular js for getting and posting messages