Added tests and clear database endpoint in server.