You need to call
die() at the end of your script. Simply returning or echoing will not suffice.
WordPress by default returns 0 as a return code (0 being no errors detected) if you do not specify a return value (by calling
Here's some additional details, and there's more in the WP Codex: https://wordpress.org/support/topic/ajax-call-returns-0