class CatalogRest {

    @PUT
    @Path("{catalogId}/records/{recordId}/branches/{branchId}")
    @Produces(MediaType.APPLICATION_JSON)
    @Consumes(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Updates a specific Branch for a specific VersionedRDFRecord.")
    @ActionId(value = Modify.TYPE)
    @ResourceId(type = ValueType.PATH, value = "recordId")
    public Response updateBranch(@PathParam("catalogId") String catalogId,
                          @PathParam("recordId") String recordId,
                          @PathParam("branchId") String branchId,
                          String newBranchJson) {
        try {
            Branch newBranch = getNewThing(newBranchJson, vf.createIRI(branchId),
                    factoryRegistry.getFactoryOfType(Branch.class).get());
            catalogManager.updateBranch(vf.createIRI(catalogId), vf.createIRI(recordId), newBranch);
            return Response.ok().build();
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}