I need to a have custom table and need to expose the details via a custom REST API as JSON data. Is there any example or documentation to explain the steps or way to achieve it ?
You could try the Friends of Symfony REST bundle. You can add annotations to Controller routes and this will then generate a page summarising all the API endpoints.
I haven’t used this in conjunction with Pimcore but it was useful in another Symfony application. Don’t see any reason why it won’t work with Pimcore.