Return JSON instead of redirecting for signup, login, logout, verify_stamp, and verify_stamp_by_code