Updated logout functionality return data as json string