fixing server's response to the client app by adding failure codes