protected override void Handle(PopulateMessagesRequestPacket packet, Socket sender)
        {
            var data = packet.Data;

            System.Console.WriteLine(1);
            System.Console.WriteLine(Encoding.UTF8.GetString(packet.Buffer));
            if (data == null)
            {
                return;
            }
            System.Console.WriteLine(2);
            // check whether request is valid
            var channel = channelCrud.ReadOneById(data.forChannel);

            if (channel == null)
            {
                SendError(HttpStatusCode.BadRequest, sender);
                return;
            }

            // fetch messages that match page and channel
            List <PopulatedMessage> paginatedMessages = messageCrud.ReadManyPaginated(channel._id, data.page, PAGE_SIZE);

            var response = new PopulateMessagesResponsePacket(new PopulateMessagesResponsePacketData(
                                                                  (int)HttpStatusCode.OK, data.page, paginatedMessages
                                                                  ));

            System.Console.WriteLine("SENDIN");
            Zephy.serverSocket.SendPacket(response, sender);
        }
        void SendError(HttpStatusCode status, Socket sender)
        {
            var response = new PopulateMessagesResponsePacket(new PopulateMessagesResponsePacketData(
                                                                  (int)status, 0, null
                                                                  ));

            Zephy.serverSocket.SendPacket(response, sender);
        }