class CatalogRest {

    @GET
    @Path("{catalogId}/records/{recordId}/branches/master")
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Gets the master Branch of a VersionedRDFRecord.")
    @ResourceId(type = ValueType.PATH, value = "recordId")
    public Response getMasterBranch(@PathParam("catalogId") String catalogId,
                             @PathParam("recordId") String recordId) {
        try {
            Branch masterBranch = catalogManager.getMasterBranch(vf.createIRI(catalogId), vf.createIRI(recordId));
            return Response.ok(thingToSkolemizedObjectNode(masterBranch, Branch.TYPE, transformer, bNodeService)
                    .toString()).build();
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (IllegalStateException | MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}