Small changes, now only flushing local database when we got the data from the server, and postdate change to datetime format YYYY-MM-DD HH:MM:SS.