fixed bugs with deprecated methods used; added json_encode_ex to support php5.3; fixed bug with duplicating displayed posts when posting new one