diff --git a/restful.py b/restful.py
index <HASH>..<HASH> 100644
--- a/restful.py
+++ b/restful.py
@@ -27,8 +27,6 @@ from werkzeug.utils import secure_filename
 
 from invenio.ext.restful import require_api_auth, error_codes, \
     require_oauth_scopes, require_header
-from invenio.modules.oauth2server.registry import scopes
-from invenio.modules.oauth2server.models import Scope
 from invenio.modules.deposit.models import Deposition, \
     DepositionFile, InvalidDepositionType, DepositionDoesNotExists, \
     DraftDoesNotExists, FormDoesNotExists, DepositionNotDeletable, \
@@ -622,6 +620,8 @@ def setup_app(app, api):
 
     # Register scopes
     with app.app_context():
+        from invenio.modules.oauth2server.models import Scope
+        from invenio.modules.oauth2server.registry import scopes
         scopes.register(Scope(
             'deposit:write',
             group='Deposit',
oauth2server: access and refresh tokens encrytion

* Uses encryption field for seamless encryption/decryption of the access
  and refresh tokens. (addresses #<I>)