Error Handling from ajax calls and Ajax calls common functions