who wrote the song cake by the ocean