This is the code for the Carl API