Refactored code in authorize_controller.
Bug fix in authorize controller, access token action.