Move API Errors to JSON