Adding exit in lp ajax calls.
Fixing SQL queries.