hacked up to work with current server api.