Added error handling and API routes