API for GET requests with automatic error handling