Change logout status code and add small test