Easily parse and handle json error packets from a Rails API