returns json error on api access denied.