Fixed server connections and JSON formatting