refactored out axalx logic out of api route

Refactored avalx logic into avalx.js