Updated to work with version 2 of beach api.