Updated errors handling. Added sandbox mode support.