def get_questions(): categories = Category.query.all() page = request.args.get('page', 1, type=int) current_category = request.args.get('category', None) page_questions, total_questions = Question.paginate( page, current_category) if len(page_questions) == 0 or page < 1: abort(404) return jsonify({ 'success': True, 'questions': page_questions, 'total_questions': total_questions, 'current_category': int(current_category), 'categories': {cat.id: cat.type for cat in categories} }), 200