Custom REST endpoints for a custom post type with custom fields

Actually I found my answer after diving into the WordPress’s core code.
Yes, it is possible to do such a thing, all you need is to use the following function:
register_rest_route

There are some tricky parts though. This function uses regular expressions and now I am going to figure out how to use that in this function.