Position a rack in the center of the oven and preheat oven to 350 degrees. Lightly spray an 9-inch cake pan with gluten-free non-stick cooking spray, cut a piece of parchment to fit the bottom of the pan, place it in the pan and spray that lightly.
In a medium mixing bowl whisk together the flour, baking powder, baking soda, salt, espresso and cocoa powders.
In a mixing bowl of an electric mixer, preferably fitted with a paddle attachment, cream together the butter and sugar on medium high speed until light, about 2 minutes. Scrape down the sides of the bowl, turn the mixer to low and add the eggs one at a time, mixing well after each addition.
With the mixer on low, slowly add half the flour mixture, the sour cream and then the remaining flour mixture. Add the melted chocolate and vanilla and mix until just blended. The batter will be thick. Using a spatula, give the batter a final mix by hand to make sure all the ingredients are fully incorporated. Put the batter into the prepared pan.
Bake for 40-50 minutes or until a tooth pick inserted in the center comes out clean. Let cool in pan for 5 minutes and then transfer to a wire rack to finish cooling. Serve warm, room temperature or cold with whipped cream and berries if desired.
Notes
*If you use another gluten-free all-purpose flour, add ½ teaspoon xanthan gum to the recipe if your flour does not contain it.