1. Add return error code. 2. Query total items.