Fix problem about returning JSON from server.