// POST api/Announcement
        //public HttpResponseMessage PostAnnouncement(Announcement announcement)
        //{
        //    if (ModelState.IsValid)
        //    {
        //        db.Announcements.Add(announcement);
        //        db.SaveChanges();
        //        HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, announcement);
        //        response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = announcement.A_id }));
        //        return response;
        //    }
        //    else
        //    {
        //        return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
        //    }
        //}
        public String PostAnnouncement(NotificationMessage notificationMessage)
        {
            // Add to db
            Announcement ann = new Announcement
            {
                A_content = notificationMessage.msg,
                A_datetime = DateTime.Now
            };
            db.Announcements.Add(ann);
            db.SaveChanges();

            String[] regIDs = db.GCMs.Select(g => g.Gcm_regID).ToArray();

            String sResponseFromServer = Util.sendNotificationMsg(notificationMessage.msg, regIDs);

            return sResponseFromServer;
        }
        // PUT api/Announcement/5
        public HttpResponseMessage PutAnnouncement(int id, Announcement announcement)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            if (id != announcement.A_id)
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }

            db.Entry(announcement).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
            }

            return Request.CreateResponse(HttpStatusCode.OK);
        }