added routes, error handling