Hey we don't need a template in an API :) Added in some JSON bits and decent errors.