I haven't actually worked with it, but I've been eyeing the documentation. The feature you're looking for is called the Episerver Content Delivery Api and I believe it comes in the form of a nuget package. Good luck!
You can refer these articles -
having done the developers courses, and read through the online docs, I can create pages, blocks, controllers views etc.
I know epi has some support for headerless, which basically means an api returning something like json.
Can anyone point me to any info on how to create a page which returns json from the blocks which the CMS editor put there via the CMS? I cant seem to find this anywhere.
An example would be even better!