switches to WP_Error for error sending in ajax