def routines(userId): try: thisUser = User(userId=userId) if thisUser == None : return jsonify(error="User not found") return thisUser.getRoutines() except : raise