refactor parse_json
got #post to work