webPanels and repopage: what to return?


I am developing an app that exposes webPanels and repoPages. I am trying to return HTML when I get these requests on my webserver but bitbucket does not load them. How my server should answer? I tried to find any documentation on what atlassian products expect but the documentation seems to be non-existent. Any clue as to what should I return and what format?