reformating
changes to return correct error in case of 403 and 401